:root {
    --auth-bg: #f2f8f9;
    --auth-surface: #ffffff;
    --auth-ink: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #d5e6e8;
    --auth-accent: #008694;
    --auth-accent-dark: #007985;
    --auth-accent-soft: #e8f6f7;
    --auth-ok: #166534;
    --auth-ok-bg: #dcfce7;
    --auth-err: #b91c1c;
    --auth-err-bg: #fee2e2;
    --auth-radius: 14px;
    --auth-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    --auth-font: "IBM Plex Sans", system-ui, sans-serif;
}

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

html, body {
    margin: 0;
    min-height: 100%;
}

body.auth-body {
    font-family: var(--auth-font);
    color: var(--auth-ink);
    background: var(--auth-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--auth-accent);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(280px, 1.05fr) minmax(320px, 1fr);
}

.auth-panel {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.auth-panel--brand {
    position: relative;
    padding: 2rem 2.5rem;
    color: #fff;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(0, 168, 180, 0.35), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 90%, rgba(0, 134, 148, 0.45), transparent 50%),
        linear-gradient(155deg, #043f45 0%, #055a62 45%, #007985 100%);
    justify-content: space-between;
}

.auth-panel--brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.auth-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
}
.auth-brand img {
    height: 36px;
    width: auto;
    filter: brightness(0) invert(1);
}
.auth-brand--mobile {
    display: none;
    margin-bottom: 1.5rem;
}
.auth-brand--mobile img {
    filter: none;
    height: 32px;
}

.auth-brand-copy {
    position: relative;
    z-index: 1;
    max-width: 28rem;
    margin: 3rem 0;
}
.auth-brand-copy h1 {
    margin: 0 0 0.85rem;
    font-size: clamp(1.55rem, 2.4vw, 2.1rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.auth-brand-copy p {
    margin: 0 0 1.5rem;
    font-size: 1.02rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
}

.auth-brand-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}
.auth-brand-points li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}
.auth-brand-points i {
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.auth-brand-foot {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
}
.auth-brand-foot a {
    color: rgba(255, 255, 255, 0.85);
}

.auth-panel--form {
    background: var(--auth-bg);
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.auth-form-wrap {
    width: 100%;
    max-width: 420px;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: calc(var(--auth-radius) + 4px);
    box-shadow: var(--auth-shadow);
    padding: 2rem 1.75rem 1.75rem;
}

.auth-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--auth-accent);
}

.auth-title {
    margin: 0 0 0.4rem;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.auth-lead {
    margin: 0 0 1.5rem;
    color: var(--auth-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-alert {
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}
.auth-alert--error {
    background: var(--auth-err-bg);
    color: var(--auth-err);
    border: 1px solid #fecaca;
}
.auth-alert--ok {
    background: var(--auth-ok-bg);
    color: var(--auth-ok);
    border: 1px solid #bbf7d0;
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-ink);
}

.auth-field input,
.auth-field select,
.auth-form input.form-control,
.auth-form select.form-control {
    width: 100%;
    height: 2.75rem;
    padding: 0 0.9rem;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: #fff;
    color: var(--auth-ink);
    font: inherit;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[autocomplete="one-time-code"] {
    letter-spacing: 0.35em;
    font-weight: 600;
    text-align: center;
    font-size: 1.15rem;
}
.auth-field input:focus,
.auth-field select:focus,
.auth-form input.form-control:focus,
.auth-form select.form-control:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(0, 134, 148, 0.15);
}
.auth-field input::placeholder {
    color: #94a3b8;
}

.auth-password {
    position: relative;
}
.auth-password input {
    padding-right: 2.75rem;
}
.auth-password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.2rem;
    height: 2.2rem;
    border: 0;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.auth-password-toggle:hover {
    color: var(--auth-ink);
    background: var(--auth-bg);
}

.auth-field-error,
.auth-form .invalid-feedback,
.auth-form ul {
    margin: 0.35rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.8rem;
    color: var(--auth-err);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: -0.25rem;
}
.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.875rem;
    color: var(--auth-muted);
    cursor: pointer;
    user-select: none;
}
.auth-check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--auth-accent);
}
.auth-link-muted {
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 2.85rem;
    margin-top: 0.35rem;
    border: 0;
    border-radius: 10px;
    background: var(--auth-accent);
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}
.auth-btn:hover {
    background: var(--auth-accent-dark);
    text-decoration: none;
    color: #fff;
}
.auth-btn:active {
    transform: translateY(1px);
}
.auth-btn--ghost {
    background: transparent;
    color: var(--auth-accent);
    border: 1px solid var(--auth-border);
}
.auth-btn--ghost:hover {
    background: var(--auth-accent-soft);
    color: var(--auth-accent-dark);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 1rem;
    color: var(--auth-muted);
    font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.auth-footer {
    margin: 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--auth-muted);
}
.auth-footer a {
    font-weight: 600;
}

.auth-status-icon {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 1rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-accent-soft);
    color: var(--auth-accent);
    font-size: 1.35rem;
}
.auth-status-icon--ok {
    background: var(--auth-ok-bg);
    color: var(--auth-ok);
}
.auth-status-icon--warn {
    background: #fef3c7;
    color: #b45309;
}

.auth-status .auth-title,
.auth-status .auth-lead {
    text-align: center;
}

.auth-actions {
    display: grid;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }
    .auth-panel--brand {
        display: none;
    }
    .auth-brand--mobile {
        display: inline-flex;
    }
    .auth-panel--form {
        min-height: 100vh;
        padding: 1.25rem;
    }
    .auth-form-wrap {
        box-shadow: none;
        border: 0;
        background: transparent;
        padding: 0.5rem 0 1rem;
        max-width: 400px;
    }
}
