:root {
    --gl-ink: #102a43;
    --gl-muted: #627d98;
    --gl-line: #d9e2ec;
    --gl-teal: #0f766e;
    --gl-teal-dark: #115e59;
    --gl-surface: #ffffff;
    --gl-bg-1: #e8f4f2;
    --gl-bg-2: #f4f7fb;
}

* { box-sizing: border-box; }

body.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'IBM Plex Sans', sans-serif;
    color: var(--gl-ink);
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(15, 118, 110, 0.18), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(3, 105, 161, 0.12), transparent 50%),
        linear-gradient(165deg, var(--gl-bg-1) 0%, var(--gl-bg-2) 45%, #eef2f6 100%);
    position: relative;
    overflow-x: hidden;
}

body.auth-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(16, 42, 67, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 42, 67, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem 3rem;
}

.auth-stage {
    width: min(440px, 100%);
    animation: authRiseIn 0.55s ease both;
}

.auth-stage-wide {
    width: min(560px, 100%);
}

@keyframes authRiseIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.brand-block {
    text-align: center;
    margin-bottom: 1.5rem;
    animation: authRiseIn 0.65s ease 0.05s both;
}

.brand-block a {
    text-decoration: none;
    color: inherit;
}

.brand-mark {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(15, 118, 110, 0.12);
    color: var(--gl-teal);
    font-size: 1.45rem;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.18);
    animation: authPulseSoft 2.8s ease-in-out infinite;
}

@keyframes authPulseSoft {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.brand-name {
    font-family: 'Sora', sans-serif;
    font-size: clamp(2rem, 5vw, 2.45rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--gl-ink);
    margin: 0;
    line-height: 1.1;
}

.brand-tag {
    margin: 0.65rem auto 0;
    color: var(--gl-muted);
    font-size: 0.98rem;
    line-height: 1.45;
    max-width: 32ch;
}

.auth-card {
    background: var(--gl-surface);
    border: 1px solid var(--gl-line);
    border-radius: 18px;
    box-shadow:
        0 1px 2px rgba(16, 42, 67, 0.05),
        0 18px 40px rgba(16, 42, 67, 0.08);
    padding: 1.5rem 1.35rem 1.35rem;
    animation: authRiseIn 0.7s ease 0.1s both;
}

@media (min-width: 480px) {
    .auth-card { padding: 1.75rem 1.75rem 1.5rem; }
}

.auth-card h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    color: var(--gl-ink);
}

.auth-card .auth-lead {
    margin: 0 0 1.15rem;
    color: var(--gl-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.auth-card .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #486581;
    margin-bottom: 0.35rem;
}

.auth-card .input-group-text {
    background: #f8fafc;
    border: 1px solid var(--gl-line);
    border-right: 0;
    color: var(--gl-muted);
}

.auth-card .form-control {
    border: 1px solid var(--gl-line);
    padding: 0.7rem 0.85rem;
    color: var(--gl-ink);
    background: #fff;
    border-radius: 8px;
}

.auth-card .input-group .form-control {
    border-left: 0;
    border-radius: 0 8px 8px 0;
}

.auth-card .input-group .input-group-text {
    border-radius: 8px 0 0 8px;
}

.auth-card .input-group .btn {
    border: 1px solid var(--gl-line);
    border-left: 0;
    color: var(--gl-muted);
    background: #f8fafc;
}

.auth-card .form-control:focus {
    border-color: var(--gl-teal);
    box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.15);
}

.auth-card .input-group:focus-within .input-group-text,
.auth-card .input-group:focus-within .btn {
    border-color: var(--gl-teal);
    color: var(--gl-teal);
}

.auth-card .form-check-label {
    color: var(--gl-muted);
    font-size: 0.88rem;
}

.auth-card .form-check-label .btn-link {
    color: var(--gl-teal);
    text-decoration: none;
    font-weight: 600;
}

.auth-card .form-check-input:checked {
    background-color: var(--gl-teal);
    border-color: var(--gl-teal);
}

.auth-card .form-text {
    color: #829ab1;
}

.btn-gl-primary {
    background: var(--gl-teal);
    border: 1px solid var(--gl-teal);
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-gl-primary:hover,
.btn-gl-primary:focus {
    background: var(--gl-teal-dark);
    border-color: var(--gl-teal-dark);
    color: #fff;
    transform: translateY(-1px);
}

.btn-gl-outline {
    background: transparent;
    border: 1px solid var(--gl-line);
    color: var(--gl-ink);
    font-weight: 600;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn-gl-outline:hover {
    border-color: var(--gl-teal);
    color: var(--gl-teal);
    background: rgba(15, 118, 110, 0.06);
}

.auth-alert {
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.auth-alert-danger {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.auth-alert-success {
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #065f46;
}

.auth-alert a {
    color: var(--gl-teal);
    font-weight: 600;
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.85rem;
    margin-top: 1rem;
    font-size: 0.88rem;
}

.auth-links a {
    color: var(--gl-teal);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover { text-decoration: underline; }

.auth-divider {
    border: 0;
    border-top: 1px solid var(--gl-line);
    margin: 1.15rem 0;
}

.auth-foot {
    text-align: center;
    margin-top: 1.25rem;
    color: var(--gl-muted);
    font-size: 0.82rem;
    animation: authRiseIn 0.75s ease 0.15s both;
}

.auth-foot a {
    color: var(--gl-teal);
    text-decoration: none;
    font-weight: 600;
}

.auth-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.88rem;
}

.auth-countdown .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
    color: var(--gl-teal);
}
