/* ===== AUTH PAGES SHARED STYLES ===== */
/* Shared across: login, register, forgot_password, reset_password, change_password */

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

body {
    background: #f1f5f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: 80px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* Auth Navbar */
.auth-navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255,255,255,0.9); backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    height: 60px; display: flex; align-items: center;
    padding: 0 24px;
}
.auth-navbar-brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: #0f172a;
    font-weight: 700; font-size: 16px;
}
.auth-navbar-brand .nav-icon {
    width: 34px; height: 34px;
    background: #6366f1;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.auth-navbar-brand .nav-icon i { font-size: 14px; color: white; }
.auth-navbar-actions { margin-left: auto; }
.auth-navbar-actions .btn-nav {
    background: #6366f1;
    color: white; border: none; border-radius: 8px;
    font-weight: 600; font-size: 13px;
    padding: 8px 18px; text-decoration: none;
    transition: all 0.2s;
}
.auth-navbar-actions .btn-nav:hover {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
    transform: translateY(-1px);
}
.auth-navbar-actions .btn-nav:focus,
.auth-navbar-actions .btn-nav:active {
    background: #4338ca;
    color: #ffffff;
}

/* Decorative background shapes */
body::before {
    content: '';
    position: fixed;
    top: -40%; right: -20%;
    width: 700px; height: 700px;
    background: rgba(99,102,241,0.04);
    border-radius: 50%;
    pointer-events: none;
}
body::after {
    content: '';
    position: fixed;
    bottom: -30%; left: -15%;
    width: 500px; height: 500px;
    background: rgba(139,92,246,0.03);
    border-radius: 50%;
    pointer-events: none;
}

/* Wrapper */
.auth-wrapper {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.5s ease both;
}
.auth-wrapper--wide { max-width: 480px; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Brand Header */
.brand-header {
    text-align: center;
    margin-bottom: 32px;
}
.brand-header .brand-icon {
    width: 56px; height: 56px;
    background: #6366f1;
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.brand-header .brand-icon i { font-size: 24px; color: white; }
.brand-header .brand-icon--amber { background: #f59e0b; box-shadow: 0 4px 16px rgba(245,158,11,0.3); }
.brand-header h1 {
    font-size: 22px; font-weight: 800;
    color: #0f172a; margin: 0;
    letter-spacing: -0.03em;
}
.brand-header p {
    color: #94a3b8; font-size: 14px;
    margin: 6px 0 0;
}

/* Auth Card */
.auth-card {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
}

/* Form Elements */
.form-label {
    font-weight: 600; font-size: 13px;
    color: #0f172a; margin-bottom: 6px;
}
.form-control {
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    padding: 11px 14px;
    font-size: 14px;
    transition: all 0.2s;
    background: #ffffff;
}
.form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
    outline: none;
}
.form-control::placeholder { color: #94a3b8; }
.input-icon-wrap { position: relative; }
.input-icon-wrap .form-control { padding-left: 42px; }
.input-icon-wrap .input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: 14px; pointer-events: none;
    z-index: 2;
}
.input-icon-wrap .form-control:focus ~ .input-icon,
.input-icon-wrap:focus-within .input-icon {
    color: #6366f1;
}

/* Password toggle button */
.password-toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; padding: 4px;
    color: #94a3b8; cursor: pointer; z-index: 2;
    line-height: 1; font-size: 14px;
    transition: color 0.2s;
}
.password-toggle:hover,
.password-toggle:focus { color: #6366f1; outline: none; }
/* Toggle stays grey in every state — never inherits focus/invalid color */
.input-icon-wrap .password-toggle { color: #94a3b8 !important; }
.input-icon-wrap .password-toggle:hover,
.input-icon-wrap .password-toggle:focus { color: #6366f1 !important; }
/* Strip Bootstrap's built-in red/green validation SVG icon — it clashes with the toggle button */
.input-icon-wrap .form-control.is-invalid,
.input-icon-wrap .form-control.is-valid,
.was-validated .input-icon-wrap .form-control:invalid,
.was-validated .input-icon-wrap .form-control:valid {
    background-image: none !important;
    padding-right: 40px !important;
}
/* Remove green "valid" border/feedback entirely — only show red invalid state */
.auth-card .form-control.is-valid,
.auth-card .form-select.is-valid,
.was-validated .auth-card .form-control:valid,
.was-validated .auth-card .form-select:valid {
    border-color: #e2e8f0 !important;
    background-image: none !important;
}
.auth-card .valid-feedback { display: none !important; }
/* invalid-feedback is a sibling of input-icon-wrap, not the input — use :has() to bridge the gap */
.input-icon-wrap:has(.is-invalid) ~ .invalid-feedback { display: block; }
.input-icon-wrap input[type="password"],
.input-icon-wrap input[type="text"].is-password {
    padding-right: 40px;
}
.form-hint {
    font-size: 12px; color: #94a3b8;
    margin-top: 4px;
}
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Auth Button */
.btn-auth {
    background-color: #6366f1;
    color: #ffffff; border: none;
    border-radius: 8px;
    font-weight: 600; font-size: 14px;
    padding: 12px 24px;
    width: 100%;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
    --bs-btn-color: #ffffff;
    --bs-btn-bg: #6366f1;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: #4f46e5;
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: #4338ca;
    --bs-btn-focus-shadow-rgb: 99, 102, 241;
}
.btn-auth:hover {
    background-color: #4f46e5;
    box-shadow: 0 6px 20px rgba(99,102,241,0.35);
    transform: translateY(-1px);
    color: #ffffff;
}
.btn-auth:focus,
.btn-auth:focus-visible {
    background-color: #6366f1;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.4);
}
.btn-auth:active {
    background-color: #4338ca;
    color: #ffffff;
    transform: scale(0.98);
}

/* Alert */
.alert {
    border-radius: 10px; border: none;
    padding: 12px 16px; font-size: 13px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Auth Link */
.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #64748b;
}
.auth-link a {
    color: #6366f1; font-weight: 600;
    text-decoration: none;
}
.auth-link a:hover { text-decoration: underline; }

/* Social Login */
.social-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 20px 0 16px;
    color: #94a3b8; font-size: 13px; font-weight: 500;
}
.social-divider::before, .social-divider::after {
    content: ''; flex: 1; height: 1px; background: #e2e8f0;
}
.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 11px 20px;
    background: #ffffff; color: #334155;
    border: 1.5px solid #e2e8f0; border-radius: 8px;
    font-weight: 600; font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}
.btn-google:hover {
    border-color: #6366f1; background: #f8fafc;
    box-shadow: 0 2px 8px rgba(99,102,241,0.12);
    color: #334155;
}
.btn-google:active { transform: scale(0.98); }
.btn-google svg { flex-shrink: 0; }

/* Notice Box (change password) */
.notice-box {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}
.notice-box p {
    margin: 0; color: #92400e; font-size: 13px; line-height: 1.5;
}
.notice-box i { color: #d97706; }

/* Password Strength Meter */
.password-strength {
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    margin-top: 8px;
    overflow: hidden;
}
.password-strength .bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: all 0.3s;
}

/* Mobile */
@media (max-width: 576px) {
    body { padding: 16px; }
    .auth-card { padding: 24px; border-radius: 14px; }
    .brand-header .brand-icon { width: 48px; height: 48px; }
    .brand-header .brand-icon i { font-size: 20px; }
    .brand-header h1 { font-size: 20px; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .form-control { font-size: 16px; padding: 12px 14px; }
    .input-icon-wrap .form-control { padding-left: 42px; }
}
