/* ============================================================================
   Modibbo Girei — authentication screens
   ----------------------------------------------------------------------------
   Sign-in, and the forced password change that PasswordChangeGate serves before
   letting a flagged user reach the portal.

   Standalone: these pages load tokens + base + components + this file, and
   nothing else. No portal shell, no jQuery, no icon fonts beyond the one mark.

   Replaces a 40-line inline <style> block in auth/login.php that hard-coded
   #0d47a1 and a dark glassmorphism panel — a look the rest of the application
   no longer shares. Removing it also takes one more inline <style> out of the
   codebase, which is what eventually lets 'unsafe-inline' come out of the CSP's
   style-src.

   Two-column on desktop: a quiet brand panel beside the form. The panel is
   decorative and is dropped entirely below 900px rather than stacked, because a
   sign-in screen should be the form and nothing else on a phone.
   ============================================================================ */

.a-page {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
    background: var(--surface-page);
}
@media (min-width: 900px) {
    .a-page { grid-template-columns: 1.1fr 1fr; }
}

/* ---- Brand panel --------------------------------------------------------- */
.a-brand {
    display: none;
    position: relative;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-12);
    overflow: hidden;
    background: var(--c-teal-800);
    color: #fff;
}
@media (min-width: 900px) { .a-brand { display: flex; } }

/* A lineage motif drawn in CSS rather than shipped as an image: concentric
   rings spreading from a single point, which is what the record is. */
.a-brand::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 900px;
    height: 900px;
    transform: translate(-50%, -50%);
    background:
        radial-gradient(circle, transparent 0 118px, rgba(255,255,255,.07) 118px 120px, transparent 120px),
        radial-gradient(circle, transparent 0 198px, rgba(255,255,255,.06) 198px 200px, transparent 200px),
        radial-gradient(circle, transparent 0 298px, rgba(255,255,255,.05) 298px 300px, transparent 300px),
        radial-gradient(circle, transparent 0 418px, rgba(255,255,255,.04) 418px 420px, transparent 420px);
    pointer-events: none;
}
.a-brand > * { position: relative; }

.a-brand__mark {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-tight);
}
.a-brand__mark::before {
    /* The family tree mark, replacing the placeholder dot. */
    content: "";
    width: 26px;
    height: 26px;
    background: url("/assets/img/logo.svg") center / contain no-repeat;
}

.a-brand__headline {
    max-width: 22ch;
    margin: 0;
    font-size: var(--fs-3xl);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-tight);
    color: #fff;
    text-wrap: balance;
}
.a-brand__sub {
    max-width: 40ch;
    margin: var(--space-4) 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: var(--fs-base);
}
.a-brand__foot {
    color: rgba(255, 255, 255, 0.55);
    font-size: var(--fs-xs);
}

/* ---- Form side ----------------------------------------------------------- */
.a-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-8) var(--space-6);
}
.a-form {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

/* Shown only on small screens, where the brand panel is hidden. */
.a-form__mark {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
}
.a-form__mark::before {
    content: "";
    width: 22px; height: 22px;
    background: url("/assets/img/logo.svg") center / contain no-repeat;
}
@media (min-width: 900px) { .a-form__mark { display: none; } }

.a-form__title {
    margin: 0 0 var(--space-1);
    font-size: var(--fs-xl);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-tight);
}
.a-form__sub {
    margin: 0 0 var(--space-6);
    color: var(--text-muted);
    font-size: var(--fs-sm);
}
.a-form form { margin: 0; }
.a-form__actions { margin-top: var(--space-5); }
.a-form__foot {
    margin-top: var(--space-8);
    color: var(--text-muted);
    font-size: var(--fs-xs);
    text-align: center;
}

/* ---- Password field with a reveal control -------------------------------- */
.a-password { position: relative; }
.a-password .c-input { padding-right: var(--space-10); }
.a-password__toggle {
    position: absolute;
    right: var(--space-1);
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-muted);
    cursor: pointer;
}
.a-password__toggle:hover { color: var(--text-primary); background: var(--surface-hover); }
.a-password__toggle:focus-visible { outline: none; box-shadow: var(--ring-focus); }

/* ---- Password strength --------------------------------------------------- */
.a-strength { margin-top: var(--space-2); }
.a-strength__track {
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--surface-sunken);
    overflow: hidden;
}
.a-strength__bar {
    height: 100%;
    width: 0;
    border-radius: var(--radius-full);
    background: var(--status-danger-border);
    transition: width var(--duration-base) var(--ease-out),
                background var(--duration-base) var(--ease-out);
}
.a-strength__label {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}
.a-strength[data-level="2"] .a-strength__bar { width: 40%; background: var(--status-warning-border); }
.a-strength[data-level="3"] .a-strength__bar { width: 70%; background: var(--highlight); }
.a-strength[data-level="4"] .a-strength__bar { width: 100%; background: var(--status-success-border); }
.a-strength[data-level="1"] .a-strength__bar { width: 15%; }
