/* ========================================
   Eurasian Campus Research Unit
   Modern Responsive Design System
   ======================================== */

:root {
    --primary: #1e3a5f;
    --primary-light: #2a5298;
    --primary-dark: #0f2744;
    --accent: #00b4d8;
    --accent-hover: #0096c7;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg: #f0f4f8;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --input-bg: #f8fafc;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.25s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Header ---------- */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.logo-text span {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.85;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* ---------- Main ---------- */
.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.container {
    width: 100%;
    max-width: 460px;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 1.75rem 1.5rem;
    text-align: center;
}

.card-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.4px;
    margin-bottom: 0.35rem;
}

.card-header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.card-body {
    padding: 1.75rem 1.5rem 2rem;
}

/* ---------- Form ---------- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.form-group label .hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.input-wrapper {
    position: relative;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}

.form-control.is-invalid {
    border-color: var(--error);
}

.form-control.is-valid {
    border-color: var(--success);
}

.form-control::placeholder {
    color: #94a3b8;
}

/* Password toggle */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
}

.toggle-password:hover {
    color: var(--primary);
}

/* Field feedback */
.field-error {
    font-size: 0.78rem;
    color: var(--error);
    margin-top: 0.35rem;
    display: none;
}

.field-error.show {
    display: block;
}

.field-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* Password strength meter */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
}

.strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 180, 216, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 180, 216, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Alerts */
.alert {
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Footer links */
.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--accent-hover);
    font-weight: 600;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* ---------- Dashboard ---------- */
.dashboard-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

.welcome-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    text-align: center;
}

.welcome-card h1 {
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.welcome-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    text-align: left;
}

.info-item {
    background: var(--bg);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
}

.info-item .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.info-item .value {
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
}

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    padding: 1.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: white;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .header-inner {
        flex-direction: column;
        gap: 0.75rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .card-header {
        padding: 1.4rem 1.25rem;
    }

    .card-header h1 {
        font-size: 1.3rem;
    }

    .card-body {
        padding: 1.4rem 1.25rem 1.75rem;
    }

    .main {
        padding: 1.25rem 0.75rem;
    }
}

/* Loading spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
