/* =========================================================================
   Login / authentication screen.
   Standalone, full-viewport layout used by @layout/auth.html.twig — reuses the
   .field / .form-control / .ds-btn primitives from installer.css and only adds
   the centred card chrome and the navy backdrop.
   ========================================================================= */

.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--text-body);
    background: var(--bg-page);
}

.auth {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 26px;
    padding: 40px 20px 28px;
    overflow: hidden;
    background:
        radial-gradient(1100px 520px at 50% -8%, rgba(42, 94, 138, 0.35), transparent 60%),
        linear-gradient(160deg, var(--dcs-navy-900) 0%, var(--dcs-navy-700) 48%, var(--dcs-navy-800) 100%);
}

/* Subtle dotted texture behind the card. */
.auth::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 34px 34px 30px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

/* ---------- Brand ---------- */
.auth-card__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border-subtle);
}

.auth-card__logo {
    height: 34px;
    width: auto;
    padding: 7px 9px;
    border-radius: var(--radius-md);
    background: var(--dcs-navy-700);
}

.auth-card__word {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.auth-card__irix {
    font-weight: var(--fw-extrabold);
    font-size: 19px;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

.auth-card__sub {
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: var(--ls-caps);
    color: var(--text-subtle);
}

/* ---------- Heading ---------- */
.auth-card__head {
    margin-bottom: 22px;
}

/* .eyebrow is .installer-scoped in installer.css — restate it for this page. */
.auth .eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

.auth-card__title {
    margin: 8px 0 6px;
    font-size: 22px;
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-tight);
    color: var(--text-primary);
}

.auth-card__lead {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ---------- Alert banner ---------- */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 18px;
    padding: 11px 13px;
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
}

/* Warning tone — a failed sign-in or 2FA attempt is recoverable, so it reads
   as a caution (amber) rather than a hard error (red). */
.auth-alert--warning {
    color: var(--warning-shade, #9a6a12);
    background: var(--warning-soft);
    border-color: var(--warning);
}

.auth-alert__icon {
    display: inline-flex;
    flex: 0 0 auto;
}

.auth-alert__icon svg {
    width: 17px;
    height: 17px;
    display: block;
}

/* ---------- Form ---------- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* The .form-control / .input-icon primitives in installer.css are scoped under
   .installer, which this standalone page has no ancestor for — re-declare the
   parts the login form uses, tied to .auth so they stay self-contained. */
.auth .form-control {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-inset);
    appearance: none;
    -webkit-appearance: none;
    transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.auth .form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: var(--shadow-focus);
}

.auth .form-control::placeholder {
    color: var(--text-subtle);
}

.auth .input-icon {
    position: relative;
    display: flex;
}

.auth .input-icon > .form-control {
    padding-left: 38px;
}

.auth .input-icon__lead {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: var(--text-subtle);
    pointer-events: none;
    z-index: 1;
}

.auth .input-icon__lead svg {
    width: 16px;
    height: 16px;
    display: block;
}

.auth .input-icon:focus-within .input-icon__lead {
    color: var(--text-muted);
}

.auth-submit {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

/* ---------- "or" divider ---------- */
.auth-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 10px;
    color: var(--text-subtle);
    font-size: 11px;
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: var(--ls-caps);
}

.auth-or::before,
.auth-or::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--border-subtle);
}

/* ---------- Google sign-in button ---------- */
/* A neutral secondary button (not the navy primary) carrying Google's own
   multicolour "G", so it reads as a third-party provider next to the branded
   Sign in action. */
.auth-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
    width: 100%;
    height: 42px;
    padding: 0 14px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    text-decoration: none;
    background: var(--surface-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-inset);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}

.auth-google:hover {
    background: var(--surface-sunken);
    border-color: var(--border-focus);
}

.auth-google:focus-visible {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: var(--shadow-focus);
}

.auth-google__icon {
    display: inline-flex;
    flex: 0 0 auto;
}

.auth-google__icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Password reveal toggle, overlaid on the right of the password field. */
.auth .input-icon:has(.auth-reveal) > .form-control {
    padding-right: 42px;
}

.auth-reveal {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-subtle);
    cursor: pointer;
    z-index: 2;
    transition: color 0.15s ease;
}

.auth-reveal:hover,
.auth-reveal.is-on {
    color: var(--text-primary);
}

.auth-reveal svg {
    width: 17px;
    height: 17px;
    display: block;
}

/* ---------- First-run hint ---------- */
.auth-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 20px 0 0;
    padding: 11px 13px;
    font-size: var(--text-xs);
    color: var(--text-muted);
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
}

.auth-hint__icon {
    display: inline-flex;
    flex: 0 0 auto;
    color: var(--info);
}

.auth-hint__icon svg {
    width: 15px;
    height: 15px;
    display: block;
}

.auth-hint b {
    font-family: var(--font-mono);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
}

/* ---------- Footer ---------- */
.auth__footer {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.66);
}

.auth__footer b {
    color: rgba(255, 255, 255, 0.86);
    font-weight: var(--fw-semibold);
}

.auth__footer-logo {
    height: 16px;
    width: auto;
    opacity: 0.8;
}

/* ---------- Two-factor code step ---------- */
/* segmented code input (OtpInput.js) — a hidden proxy carries the joined value. */
.auth .otp {
    display: flex;
    gap: 8px;
}

.auth .otp__box {
    flex: 1 1 0;
    min-width: 0;
    max-width: 52px;
    height: 48px;
    padding: 0;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 20px;
    line-height: 48px;
    color: var(--text-primary);
    background: var(--surface-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-inset);
    appearance: none;
    -webkit-appearance: none;
    transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.auth .otp__box:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: var(--shadow-focus);
}

.auth .otp.is-invalid .otp__box { border-color: var(--danger); }
.auth .otp.is-valid .otp__box { border-color: var(--success); }

/* Secondary action under the form (e.g. "sign in as a different account"). */
.auth-alt {
    margin: 16px 0 0;
    text-align: center;
}

.auth-alt__link {
    border: 0;
    background: transparent;
    padding: 4px 8px;
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-alt__link:hover { color: var(--text-primary); }

@media (max-width: 480px) {
    .auth-card {
        padding: 26px 22px 24px;
    }
}
