:root {
    --ink: #1f2937;
    --muted: #5b677a;
    --paper: #fffdf7;
    --brand: #0f766e;
    --ring: rgba(15, 118, 110, 0.2);
}

* {
    box-sizing: border-box;
}

body.auth-ui,
body.reset-ui {
    margin: 0;
    min-height: 100vh;
    font-family: 'Merriweather Sans', sans-serif;
    line-height: 1.45;
    color: var(--ink);
    background:
        radial-gradient(circle at 85% 12%, #fde68a 0%, rgba(253, 230, 138, 0) 36%),
        radial-gradient(circle at 10% 85%, #99f6e4 0%, rgba(153, 246, 228, 0) 30%),
        linear-gradient(145deg, #fffaf0 0%, #f8fafc 42%, #f0fdfa 100%);
}

.auth-shell,
.reset-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card,
.reset-card {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.14);
    overflow: hidden;
    transform: translateY(8px);
    opacity: 0;
    animation: reveal 500ms ease forwards;
}

@keyframes reveal {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-head,
.reset-head {
    padding: 22px 22px 18px;
    color: #fff;
    background: linear-gradient(130deg, #0f766e 0%, #14b8a6 52%, #22c55e 100%);
}

.auth-head h2,
.reset-head h2 {
    margin: 0;
    font-family: 'Bricolage Grotesque', sans-serif;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.25;
}

.auth-head h2 {
    font-size: 1.58rem;
}

.reset-head h2 {
    font-size: 1.62rem;
}

.auth-head p,
.reset-head p {
    margin: 8px 0 0;
    opacity: 0.92;
    font-size: 0.95rem;
}

.auth-body,
.reset-body {
    padding: 22px;
    background: var(--paper);
}

.reset-body p {
    margin: 0;
    color: var(--muted);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 0.92rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #d4d8de;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 0.95rem;
    background: #fff;
    color: var(--ink);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 4px var(--ring);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.8rem;
}

.alert {
    border-radius: 11px;
    padding: 12px 13px;
    margin-bottom: 14px;
    border: 1px solid transparent;
    font-size: 0.9rem;
}

.alert-success {
    background: #e8f8f0;
    border-color: #a7e7c2;
    color: #125c43;
}

.alert-danger,
.alert-error {
    background: #fdecec;
    border-color: #f7c3c3;
    color: #8b1d1d;
}

.btn {
    border: none;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 120ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(130deg, #0f766e, #0ea5a3);
    color: #fff;
    box-shadow: 0 10px 20px rgba(15, 118, 110, 0.22);
}

.btn-primary:hover {
    opacity: 0.96;
}

.form-footer,
.login-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e6e8ec;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.login-footer p {
    margin: 0 0 8px;
}

.form-footer a,
.login-footer a {
    color: #0f766e;
    font-weight: 700;
    text-decoration: none;
}

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

.hidden {
    display: none !important;
}

.password-strength {
    margin: 8px 0 14px;
    padding: 10px;
    border: 1px solid #dde3ea;
    border-radius: 10px;
    background: #f8fafc;
}

.strength-bar {
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: #dbe2ea;
    margin-bottom: 6px;
}

.strength-fill {
    height: 100%;
    width: 0;
    transition: width 180ms ease, background-color 180ms ease;
}

.strength-fill.weak {
    width: 34%;
    background: #e11d48;
}

.strength-fill.fair {
    width: 67%;
    background: #f59e0b;
}

.strength-fill.good {
    width: 100%;
    background: #16a34a;
}

.is-invalid {
    border-color: #e11d48 !important;
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.14) !important;
}

.success-pulse {
    width: 74px;
    height: 74px;
    margin: 10px auto 8px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #0f9d6f;
    background: #dcfce7;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
    animation: halo 1.8s infinite;
}

@keyframes halo {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
    }

    70% {
        box-shadow: 0 0 0 16px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.countdown {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--muted);
}

.reset-success-body {
    text-align: center;
}

.success-pulse-icon {
    font-size: 1.5rem;
}

.success-alert {
    text-align: left;
}

.redirect-copy {
    margin: 10px 0 4px;
}

.success-login-btn {
    margin-top: 8px;
}

@media (max-width: 520px) {
    .auth-shell,
    .reset-shell {
        padding: 12px;
    }

    .auth-card,
    .reset-card {
        border-radius: 14px;
    }

    .auth-head h2 {
        font-size: 1.38rem;
    }

    .reset-head h2 {
        font-size: 1.4rem;
    }
}
