:root {
    --bg-primary: #f1f5f9;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f0f4ff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.07);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.navbar {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.4s ease-out;
}

.navbar::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--accent-primary) 20%, var(--accent-secondary) 80%, transparent 100%);
    opacity: 0.6;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 20px;
}

.nav-brand { position: relative; cursor: pointer; }

.nav-brand h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary), #9333ea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-menu { display: flex; list-style: none; gap: 0.4rem; align-items: center; }

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.6rem 1.1rem;
    border-radius: 9px;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.92rem;
    display: inline-block;
}

.nav-menu a:hover {
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.08);
}

.nav-menu a.active {
    color: var(--accent-primary);
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    font-weight: 600;
}

.btn-logout {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-logout:hover { box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4) !important; }

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.btn {
    padding: 0.7rem 1.8rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.25s;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35); }

.btn-secondary {
    background: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
}

.btn-secondary:hover { background: var(--accent-primary); color: white; }
.btn-block { width: 100%; }

.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-box {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 6px 24px var(--shadow);
    border: 1px solid var(--border);
}

.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h2 { color: var(--text-primary); margin-bottom: 0.5rem; }
.auth-header p { color: var(--text-secondary); font-size: 0.9rem; }
.auth-form { margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1.4rem; }

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.25s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.form-hint { display: block; margin-top: 0.4rem; font-size: 0.82rem; color: var(--text-secondary); }

.text-success { color: var(--success); }
.text-error { color: var(--error); }

.password-input { position: relative; }
.password-input input { padding-right: 4rem; }

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
    border-radius: 5px;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.toggle-password:hover { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }

.password-strength { margin-top: 0.4rem; font-size: 0.82rem; }
.strength-weak { color: var(--error); }
.strength-medium { color: var(--warning); }
.strength-strong { color: var(--success); }

.alert { padding: 0.9rem 1rem; border-radius: 8px; margin-bottom: 1.25rem; font-size: 0.9rem; }
.alert-error { background: rgba(239,68,68,0.07); border: 1px solid rgba(239,68,68,0.3); color: #b91c1c; }
.alert-success { background: rgba(16,185,129,0.07); border: 1px solid rgba(16,185,129,0.3); color: #047857; }

.form-options { display: flex; justify-content: flex-end; margin-bottom: 1.25rem; }

.link-secondary { color: var(--accent-primary); text-decoration: none; font-size: 0.88rem; }
.link-secondary:hover { text-decoration: underline; }

.auth-footer { text-align: center; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.auth-footer p { color: var(--text-secondary); }
.auth-footer a { color: var(--accent-primary); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.dashboard-container { padding: 3rem 0; min-height: calc(100vh - 200px); }

.welcome-section { text-align: center; margin-bottom: 3rem; }

.welcome-section h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-message { font-size: 1.1rem; color: var(--text-secondary); }

.user-info-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    max-width: 600px;
    margin: 0 auto 2rem;
    box-shadow: 0 2px 12px var(--shadow);
}

.user-info-card h3 { color: var(--accent-primary); margin-bottom: 1.5rem; text-align: center; }

.info-list { display: flex; flex-direction: column; gap: 0.75rem; }

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    background: var(--bg-secondary);
    border-radius: 7px;
    border: 1px solid var(--border);
}

.info-label { color: var(--text-secondary); font-weight: 500; }
.info-value { color: var(--text-primary); }

.dashboard-actions { text-align: center; margin-top: 2rem; }

.footer {
    background: var(--bg-card);
    padding: 1.5rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

.footer p { color: var(--text-secondary); margin: 0.2rem 0; font-size: 0.88rem; }

.construction-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.construction-content { text-align: center; max-width: 600px; }
.construction-icon { position: relative; width: 200px; height: 200px; margin: 0 auto 2rem; }

.gear { position: absolute; border: 8px solid var(--accent-primary); border-radius: 50%; }
.gear-1 { width: 120px; height: 120px; top: 0; left: 0; animation: rotate 3s linear infinite; }
.gear-2 { width: 80px; height: 80px; bottom: 0; right: 0; border-color: var(--accent-secondary); animation: rotate-reverse 2s linear infinite; }

@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes rotate-reverse { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }

.construction-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.construction-content p { font-size: 1.2rem; color: var(--text-secondary); margin-bottom: 2rem; }
.construction-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

@media (max-width: 768px) {
    .navbar .container { flex-direction: column; gap: 1rem; }
    .nav-menu { flex-direction: column; width: 100%; gap: 0.4rem; }
    .nav-menu a { width: 100%; text-align: center; }
    .nav-brand h1 { font-size: 1.5rem; }
    .construction-content h1 { font-size: 2rem; }
    .auth-box { padding: 1.5rem; }
    .construction-icon { width: 150px; height: 150px; }
    .gear-1 { width: 90px; height: 90px; }
    .gear-2 { width: 60px; height: 60px; }
}

.readonly-input { background: var(--bg-hover); cursor: not-allowed; color: var(--text-secondary); }
#alert-container { margin-bottom: 1rem; }
input:disabled, button:disabled { opacity: 0.6; cursor: not-allowed; }
input:invalid:not(:placeholder-shown) { border-color: var(--error); }
input:valid:not(:placeholder-shown) { border-color: var(--success); }
