/* ============================================================
   Auth pages — login, register, forgot_password
   ============================================================ */

/* ── Page shell ── */
.auth-page {
    min-height: 100vh;
    background: #dde8ff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

/* ── Lava-lamp blobs — injected by auth.js ── */
.auth-blobs {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    filter: blur(56px);
}

.auth-blob {
    position: absolute;
    will-change: transform, border-radius;
}

.auth-blob--1 {
    width: 560px; height: 560px;
    background: radial-gradient(circle at 40% 40%, #bcd4fd, #93b8f0);
    top: -160px; left: -140px;
    opacity: 0.55;
    animation: blob1 20s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%;
}
.auth-blob--2 {
    width: 480px; height: 480px;
    background: radial-gradient(circle at 60% 60%, #d4c6fb, #b8a9ef);
    bottom: -120px; right: -100px;
    opacity: 0.5;
    animation: blob2 25s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    border-radius: 40% 60% 70% 30% / 50% 55% 45% 50%;
}
.auth-blob--3 {
    width: 360px; height: 360px;
    background: radial-gradient(circle at 50% 50%, #a7e8d0, #86d8bc);
    top: 35%; left: 58%;
    opacity: 0.45;
    animation: blob3 18s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    border-radius: 55% 45% 38% 62% / 42% 58% 42% 58%;
}
.auth-blob--4 {
    width: 320px; height: 320px;
    background: radial-gradient(circle at 50% 50%, #f9b8c4, #f0a0b0);
    bottom: 15%; left: -80px;
    opacity: 0.45;
    animation: blob4 22s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    border-radius: 48% 52% 60% 40% / 56% 44% 56% 44%;
}
.auth-blob--5 {
    width: 280px; height: 280px;
    background: radial-gradient(circle at 50% 50%, #fde7a0, #f9d878);
    top: 10%; right: 8%;
    opacity: 0.4;
    animation: blob5 28s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    border-radius: 52% 48% 44% 56% / 48% 52% 48% 52%;
}

@keyframes blob1 {
    0%   { transform: translate(0, 0);         border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%; }
    20%  { transform: translate(70px, 90px);   border-radius: 40% 60% 60% 40% / 50% 30% 70% 50%; }
    40%  { transform: translate(120px, 10px);  border-radius: 55% 45% 35% 65% / 65% 35% 65% 35%; }
    60%  { transform: translate(50px, -80px);  border-radius: 30% 70% 55% 45% / 40% 60% 40% 60%; }
    80%  { transform: translate(-30px, -30px); border-radius: 58% 42% 48% 52% / 55% 45% 55% 45%; }
    100% { transform: translate(0, 0);         border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%; }
}
@keyframes blob2 {
    0%   { transform: translate(0, 0);           border-radius: 40% 60% 70% 30% / 50% 55% 45% 50%; }
    25%  { transform: translate(-80px, -70px);   border-radius: 60% 40% 40% 60% / 60% 40% 60% 40%; }
    50%  { transform: translate(-140px, 30px);   border-radius: 35% 65% 55% 45% / 45% 65% 35% 55%; }
    75%  { transform: translate(-60px, 80px);    border-radius: 50% 50% 65% 35% / 55% 45% 65% 35%; }
    100% { transform: translate(0, 0);           border-radius: 40% 60% 70% 30% / 50% 55% 45% 50%; }
}
@keyframes blob3 {
    0%   { transform: translate(0, 0);          border-radius: 55% 45% 38% 62% / 42% 58% 42% 58%; }
    33%  { transform: translate(-90px, 70px);   border-radius: 40% 60% 58% 42% / 58% 42% 58% 42%; }
    66%  { transform: translate(50px, -90px);   border-radius: 65% 35% 42% 58% / 35% 65% 35% 65%; }
    100% { transform: translate(0, 0);          border-radius: 55% 45% 38% 62% / 42% 58% 42% 58%; }
}
@keyframes blob4 {
    0%   { transform: translate(0, 0);          border-radius: 48% 52% 60% 40% / 56% 44% 56% 44%; }
    30%  { transform: translate(100px, -80px);  border-radius: 62% 38% 44% 56% / 44% 56% 44% 56%; }
    60%  { transform: translate(60px, 70px);    border-radius: 38% 62% 52% 48% / 50% 50% 62% 38%; }
    100% { transform: translate(0, 0);          border-radius: 48% 52% 60% 40% / 56% 44% 56% 44%; }
}
@keyframes blob5 {
    0%   { transform: translate(0, 0);           border-radius: 52% 48% 44% 56% / 48% 52% 48% 52%; }
    40%  { transform: translate(-60px, 100px);   border-radius: 38% 62% 62% 38% / 60% 40% 60% 40%; }
    70%  { transform: translate(-120px, -50px);  border-radius: 60% 40% 38% 62% / 40% 60% 40% 60%; }
    100% { transform: translate(0, 0);           border-radius: 52% 48% 44% 56% / 48% 52% 48% 52%; }
}

/* ── Card — frosted glass ── */
.auth-card {
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    padding: 2.75rem 2.5rem 2.25rem;
    box-shadow: 0 8px 40px rgba(99, 102, 241, 0.15), 0 2px 8px rgba(0,0,0,0.08);
    animation: card-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
    position: relative;
    z-index: 1;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Wider card for forgot_password (two sections) */
.auth-card--wide {
    max-width: 520px;
}

/* ── Brand header ── */
.auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1d4ed8, #6366f1);
    box-shadow: 0 8px 24px rgba(29, 78, 216, 0.35);
    margin-bottom: 0.9rem;
    animation: logo-pop 0.5s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes logo-pop {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1);   }
}

.auth-brand-logo i {
    font-size: 1.6rem;
    color: #ffffff;
}

.auth-brand h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(255,255,255,0.6);
}

.auth-brand p {
    font-size: 0.875rem;
    color: #334155;
    font-weight: 500;
    margin: 0;
}

/* ── Field groups ── */
.auth-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fields-in 0.4s 0.1s ease both;
}

@keyframes fields-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.auth-field label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e3a5f;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap .auth-input-icon {
    position: absolute;
    left: 0.875rem;
    z-index: 2;
    color: #2563eb !important;
    font-size: 0.9rem;
    pointer-events: none;
    transition: none;
}

.auth-input-wrap input {
    width: 100%;
    padding: 0.7rem 0.875rem 0.7rem 2.5rem;
    border: 1.5px solid rgba(148, 163, 184, 0.5);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
    box-sizing: border-box;
}

.auth-input-wrap input::placeholder {
    color: #94a3b8;
}

.auth-input-wrap input:focus {
    border-color: #1d4ed8;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: #2563eb !important;
}

/* password toggle */
.auth-pw-toggle {
    position: absolute;
    right: 0.875rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1;
    transition: color 0.2s;
}
.auth-pw-toggle:hover { color: #1d4ed8; }

.auth-input-wrap input[type="password"],
.auth-input-wrap input.has-toggle {
    padding-right: 2.5rem;
}

/* ── Divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ── Buttons ── */
.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.auth-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
    text-decoration: none;
}

.auth-btn:active { transform: scale(0.98); }

.auth-btn-primary {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(29, 78, 216, 0.3);
}
.auth-btn-primary:hover {
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.4);
    transform: translateY(-1px);
}

.auth-btn-sso {
    background: rgba(255, 255, 255, 0.7);
    color: #0f172a;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    width: 100%;
    box-sizing: border-box;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.auth-btn-sso:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.auth-btn-sso .sso-icon {
    width: 20px; height: 20px;
    border-radius: 4px;
    background: linear-gradient(135deg, #fd4b2d, #e63b20);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.auth-btn-sso .sso-icon i {
    font-size: 0.65rem;
    color: #fff;
}

.auth-btn-secondary {
    background: #f1f5f9;
    color: #374151;
}
.auth-btn-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

/* ── Footer links ── */
.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.auth-footer a {
    font-size: 0.875rem;
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s;
}
.auth-footer a:hover { color: #1d4ed8; }
.auth-footer a strong { color: #1d4ed8; }

/* ── Forgot password: two panels ── */
.auth-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-section {
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.25);
    transition: border-color 0.2s;
}
.auth-section:focus-within {
    border-color: #1d4ed8;
}

.auth-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.auth-section-title i {
    color: #1d4ed8;
    font-size: 0.9rem;
}

/* ── Hint text ── */
.auth-hint {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .auth-card { padding: 2rem 1.5rem 1.75rem; }
    .auth-card--wide { max-width: 100%; }
}
