/* ---------------------------------------------------------------------------
   Login screen.

   Follows the split-screen pattern from the chemavi.cm reference: a branded
   panel on the left carrying the promise, the form on the right carrying the
   work. Written from scratch against our own palette rather than copied — the
   reference ships a 53 KB stylesheet for four auth screens, and we have one.

   Palette is the site's: near-black ground, lime accent (see core/styles/style.css).
   --------------------------------------------------------------------------- */

.auth-body {
    --auth-ground: #0b0c0a;
    --auth-panel: #14161a;
    --auth-line: #ffffff26;
    --auth-text: #f2f4f0;
    --auth-muted: #a8aeaa;
    --auth-accent: #CFF85E;
    --auth-ink: #030303;
    --auth-danger: #ff8a72;

    margin: 0;
    min-height: 100vh;
    background: var(--auth-ground);
    color: var(--auth-text);
    font-family: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

/* ---- top bar ---- */

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 28px;
}

.auth-brand-mini {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    color: var(--auth-text);
    text-decoration: none;
}

.auth-brand-mini::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--auth-accent);
}

.auth-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--auth-line);
    color: var(--auth-muted);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 600;
}

.auth-back:hover {
    color: var(--auth-text);
    border-color: var(--auth-accent);
}

/* ---- the two halves ---- */

.auth-shell {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    align-items: stretch;
    gap: 0;
}

@media (max-width: 940px) {
    /* The promise panel is decoration; on a phone the form is the page. */
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        display: none;
    }
}

.auth-visual {
    position: relative;
    display: flex;
    align-items: center;
    padding: 56px 6vw;
    isolation: isolate;
    overflow: hidden;
}

.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(70% 90% at 15% 20%, rgba(207, 248, 94, .12), transparent 62%),
        radial-gradient(60% 80% at 90% 90%, rgba(255, 255, 255, .05), transparent 65%);
}

.auth-visual-content {
    max-width: 30rem;
}

.auth-eyebrow {
    display: inline-block;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--auth-accent);
    margin-bottom: 18px;
}

.auth-visual h1 {
    font-size: clamp(2rem, 3.4vw, 2.9rem);
    line-height: 1.12;
    margin: 0 0 16px;
    text-wrap: balance;
}

.auth-visual h1 em {
    font-style: normal;
    color: var(--auth-accent);
}

.auth-visual > .auth-visual-content > p {
    margin: 0 0 30px;
    color: var(--auth-muted);
    font-size: 1.02rem;
    line-height: 1.6;
    max-width: 42ch;
}

.auth-feature-list {
    display: grid;
    gap: 14px;
}

.auth-feature-list span {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--auth-muted);
    font-size: .95rem;
}

.auth-feature-list i {
    color: var(--auth-accent);
    font-size: 1.25rem;
}

/* ---- form side ---- */

.auth-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px 64px;
}

.auth-card {
    width: 100%;
    max-width: 27rem;
    padding: 40px 36px;
    border: 1px solid var(--auth-line);
    border-radius: 18px;
    background: var(--auth-panel);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 30px 22px;
    }
}

.auth-card-heading {
    margin-bottom: 28px;
}

.auth-card-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--auth-accent);
    color: var(--auth-ink);
    font-size: 1.5rem;
    margin-bottom: 18px;
}

.auth-card-heading h2 {
    margin: 0 0 8px;
    font-size: 1.5rem;
}

.auth-card-heading p {
    margin: 0;
    color: var(--auth-muted);
    font-size: .94rem;
}

/* ---- fields ---- */

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--auth-muted);
    margin-bottom: 8px;
}

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

.auth-input-icon {
    position: absolute;
    left: 14px;
    font-size: 1.15rem;
    color: var(--auth-muted);
    pointer-events: none;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border-radius: 11px;
    border: 1px solid var(--auth-line);
    background: #0a0b0d;
    color: var(--auth-text);
    font: inherit;
    font-size: .98rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-form input::placeholder {
    color: #6d746f;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(207, 248, 94, .16);
}

.auth-password-toggle {
    position: absolute;
    right: 8px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
}

.auth-password-toggle:hover {
    color: var(--auth-text);
}

/* Yii marks the wrapper, not the input, so the state has to reach inside. */
.auth-form .has-error input {
    border-color: var(--auth-danger);
}

.auth-form .help-block {
    margin: 7px 0 0;
    font-size: .84rem;
    color: var(--auth-danger);
    min-height: 0;
}

.auth-form .help-block:empty {
    display: none;
}

/* ---- remember me + submit ---- */

.auth-form-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 6px 0 24px;
}

.auth-form-meta .form-group {
    margin: 0;
}

.auth-form-meta label {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: .9rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--auth-muted);
    cursor: pointer;
}

.auth-form-meta input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--auth-accent);
    cursor: pointer;
}

.auth-submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 24px;
    border: 0;
    border-radius: 999px;
    background: var(--auth-accent);
    color: var(--auth-ink);
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.auth-submit:disabled {
    cursor: progress;
    filter: brightness(.85);
    transform: none;
}

.auth-submit-loading {
    display: none;
    align-items: center;
    gap: 10px;
}

.auth-submit.is-loading .auth-submit-label {
    display: none;
}

.auth-submit.is-loading .auth-submit-loading {
    display: inline-flex;
}

.auth-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(3, 3, 3, .25);
    border-top-color: var(--auth-ink);
    animation: auth-spin .7s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* ---- alerts ---- */

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 11px;
    font-size: .92rem;
    margin-bottom: 20px;
}

.auth-alert-success {
    background: rgba(207, 248, 94, .12);
    border: 1px solid rgba(207, 248, 94, .35);
    color: var(--auth-accent);
}

.auth-alert-error {
    background: rgba(255, 138, 114, .1);
    border: 1px solid rgba(255, 138, 114, .35);
    color: var(--auth-danger);
}

.auth-foot {
    margin: 26px 0 0;
    text-align: center;
    font-size: .86rem;
    color: var(--auth-muted);
}

@media (prefers-reduced-motion: reduce) {
    .auth-submit,
    .auth-form input {
        transition: none;
    }

    .auth-submit:hover {
        transform: none;
    }

    .auth-spinner {
        animation: none;
    }
}
