/* ─────────────────────────────────────────────────────────────────
   Panel Licence — Authentication Screens
   The split-panel sign-in surface shared by login, register,
   password reset and email verification.
   Builds on the tokens in app.css; loaded after it.
   ───────────────────────────────────────────────────────────────── */

.auth-body {
    min-height: 100vh;
    margin: 0;
    background: var(--pl-bg);
}

.auth-shell {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    min-height: 100vh;
}

/* ── Left panel: the pitch ───────────────────────────────────── */
.auth-aside {
    position: relative;
    padding: 44px 52px;
    display: flex;
    flex-direction: column;
    color: #fff;
    overflow: hidden;
    background: linear-gradient(140deg, #1b2b6b 0%, #2f4bc4 46%, #0ca678 100%);
}

/* A soft radial wash so the gradient does not read as a flat block. */
.auth-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(560px 380px at 82% 12%, rgba(255, 255, 255, .17), transparent 68%),
        radial-gradient(440px 320px at 8% 92%, rgba(255, 255, 255, .11), transparent 66%);
    pointer-events: none;
}

.auth-aside > * { position: relative; z-index: 1; }

.auth-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: auto;
}
.auth-brand:hover { text-decoration: none; color: #fff; }
.auth-brand .brand-mark {
    background: rgba(255, 255, 255, .19);
    backdrop-filter: blur(4px);
}
.auth-brand .brand-logo {
    max-height: 64px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
    display: block;
}

.auth-pitch { margin: 40px 0 auto; max-width: 460px; }
.auth-pitch h1 {
    font-size: 2.05rem;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: #fff;
    margin-bottom: 15px;
}
.auth-pitch > p {
    font-size: 1rem;
    color: rgba(255, 255, 255, .84);
    margin-bottom: 27px;
}

/* The entitlement explainer, reused from the marketing site. */
.auth-entitlements { display: grid; gap: 10px; }
.auth-entitlement {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--pl-radius-sm);
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .17);
    backdrop-filter: blur(6px);
}
.auth-entitlement .ent-icon {
    width: 32px; height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border-radius: var(--pl-radius-sm);
    background: rgba(255, 255, 255, .18);
    color: #fff;
}
.auth-entitlement .ent-label { font-weight: 650; font-size: .89rem; }
.auth-entitlement .ent-note {
    font-size: .78rem;
    color: rgba(255, 255, 255, .74);
    line-height: 1.45;
}

.auth-aside-foot {
    margin-top: 38px;
    font-size: .79rem;
    color: rgba(255, 255, 255, .62);
}

/* ── Right panel: the form ───────────────────────────────────── */
.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 44px 24px;
    background: var(--pl-bg);
}

.auth-card {
    width: 100%;
    max-width: 415px;
}

.auth-card-head { margin-bottom: 24px; }
.auth-card-head h2 {
    font-size: 1.42rem;
    letter-spacing: -.01em;
    margin-bottom: 6px;
}
.auth-card-head p {
    color: var(--pl-text-muted);
    font-size: .89rem;
    margin: 0;
}

.auth-form .field { margin-bottom: 16px; }
.auth-form .input { padding: 10px 12px; font-size: .92rem; }

/* Password field with a reveal button. */
.password-field { position: relative; }
.password-field .input { padding-right: 44px; }
.password-reveal {
    position: absolute;
    right: 4px; top: 50%;
    transform: translateY(-50%);
    width: 34px; height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    background: none;
    color: var(--pl-text-faint);
    cursor: pointer;
    border-radius: var(--pl-radius-sm);
}
.password-reveal:hover { color: var(--pl-text); background: var(--pl-surface-alt); }

/* Live strength meter on the register / reset forms. */
.strength {
    display: flex;
    gap: 4px;
    margin-top: 7px;
}
.strength-bar {
    flex: 1 1 auto;
    height: 4px;
    border-radius: 999px;
    background: var(--pl-border);
    transition: background var(--pl-transition);
}
.strength-bar.is-weak   { background: var(--pl-danger); }
.strength-bar.is-fair   { background: var(--pl-warning); }
.strength-bar.is-strong { background: var(--pl-success); }
.strength-label {
    display: block;
    margin-top: 5px;
    font-size: .76rem;
    color: var(--pl-text-muted);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    font-size: .85rem;
}
.auth-row .check { font-size: .85rem; }

.auth-submit {
    width: 100%;
    padding: 11px;
    font-size: .94rem;
    margin-bottom: 18px;
}

.auth-switch {
    text-align: center;
    font-size: .87rem;
    color: var(--pl-text-muted);
}
.auth-switch a { font-weight: 600; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    font-size: .77rem;
    color: var(--pl-text-faint);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--pl-border);
}

.auth-help {
    margin-top: 20px;
    padding: 12px 14px;
    border-radius: var(--pl-radius-sm);
    background: var(--pl-surface);
    border: 1px solid var(--pl-border);
    font-size: .81rem;
    color: var(--pl-text-muted);
}
.auth-help strong { color: var(--pl-text); }

/* Staff console sign-in carries a distinct accent so it is never
   mistaken for the customer form. */
.auth-card.is-staff .auth-card-head h2::after {
    content: "Staff only";
    display: inline-block;
    margin-left: 9px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--pl-warning-soft);
    color: var(--pl-warning);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    vertical-align: middle;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 22px;
    font-size: .84rem;
    color: var(--pl-text-muted);
}
.auth-back:hover { color: var(--pl-text); text-decoration: none; }

/* Verification-code entry. */
.code-input {
    width: 100%;
    padding: 13px;
    border: 1px solid var(--pl-border-strong);
    border-radius: var(--pl-radius-sm);
    background: var(--pl-surface);
    font-family: var(--pl-mono);
    font-size: 1.42rem;
    letter-spacing: .34em;
    text-align: center;
    text-indent: .34em;
    color: var(--pl-text);
}
.code-input:focus {
    outline: none;
    border-color: var(--pl-primary);
    box-shadow: 0 0 0 3px var(--pl-primary-soft);
}

/* ── Single-column fallback (small screens) ──────────────────── */
@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }

    .auth-aside {
        padding: 26px 24px;
        min-height: auto;
    }
    .auth-brand { margin-bottom: 22px; }
    .auth-pitch { margin: 0; }
    .auth-pitch h1 { font-size: 1.5rem; }
    .auth-pitch > p { font-size: .9rem; margin-bottom: 18px; }
    .auth-aside-foot { display: none; }

    /* Keep the entitlement explainer but trim it: on a phone the form
       is what the visitor came for. */
    .auth-entitlement .ent-note { display: none; }
    .auth-entitlement { padding: 9px 12px; }

    .auth-main { padding: 30px 20px 48px; align-items: flex-start; }
}

@media (max-width: 480px) {
    .auth-pitch h1 { font-size: 1.3rem; }
    .auth-entitlements { grid-template-columns: 1fr; }
    .auth-card-head h2 { font-size: 1.24rem; }
}
/* ── Form controls used by the sign-in and register views ─────── */
.auth-form .form-group { margin-bottom: 16px; }
.auth-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 560px) {
    .auth-form .form-row { grid-template-columns: 1fr; }
}
.auth-form label {
    display: block;
    font-size: .86rem;
    font-weight: 600;
    color: var(--pl-text);
    margin-bottom: 6px;
}
.auth-form .label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.auth-form .label-row label { margin-bottom: 6px; }
.auth-form .label-link {
    font-size: .82rem;
    font-weight: 600;
    color: var(--pl-primary);
}
.auth-form .optional { font-weight: 400; color: var(--pl-text-faint); }

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--pl-border-strong);
    border-radius: var(--pl-radius-sm);
    background: var(--pl-surface);
    color: var(--pl-text);
    font: inherit;
    font-size: .95rem;
    transition: border-color var(--pl-transition), box-shadow var(--pl-transition);
}
.auth-form input:focus {
    outline: none;
    border-color: var(--pl-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pl-primary) 18%, transparent);
}
.auth-form input.is-invalid { border-color: var(--pl-danger); }

.auth-form .input-with-action { position: relative; }
.auth-form .input-with-action input { padding-right: 68px; }
.auth-form .input-action {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 9px;
    border: 0;
    background: none;
    color: var(--pl-primary);
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-form small {
    display: block;
    margin-top: 6px;
    font-size: .8rem;
    color: var(--pl-text-faint);
}

.auth-form .checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 4px 0 18px;
    font-size: .88rem;
    font-weight: 400;
    color: var(--pl-text-muted);
    cursor: pointer;
}
.auth-form .checkbox input {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    accent-color: var(--pl-primary);
}
.auth-form .checkbox a { font-weight: 600; }

.auth-form .btn-block { width: 100%; }

/* Password strength meter (register) */
.strength-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.strength-bar {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--pl-surface-alt);
    overflow: hidden;
}
.strength-fill {
    display: block;
    height: 100%;
    background: var(--pl-danger);
    transition: width .2s ease;
}
.strength-fill.level-2 { background: var(--pl-warning); }
.strength-fill.level-3 { background: var(--pl-info); }
.strength-fill.level-4 { background: var(--pl-success); }
.strength-label {
    min-width: 84px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--pl-text-muted);
}

.auth-legal {
    margin-top: 20px;
    text-align: center;
    font-size: .8rem;
    color: var(--pl-text-faint);
}
