/* =====================================================================
   SWISS GUARD — AUTH SHELL  (swiss-auth.css)
   Sign-in, sign-out, password and access pages. Used by _AuthLayout.
   Depends on swiss-brand.css tokens.
   ===================================================================== */
html, body.sg-auth { height: 100%; }
html body.sg-auth {
    margin: 0;
    background: var(--sw-paper-2);
    color: var(--sw-ink);
    overflow-x: hidden;
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
}

/* ---------- Stage (left, ink) ---------- */
.auth-stage {
    position: relative;
    overflow: hidden;
    color: var(--sw-text-on-navy);
    background:
        radial-gradient(900px 600px at 82% 78%, rgba(93,107,169,.32), rgba(93,107,169,0) 60%),
        radial-gradient(600px 420px at 8% 0%, rgba(40,44,104,.55), rgba(40,44,104,0) 70%),
        linear-gradient(160deg, #001433 0%, #041d42 48%, #0a2748 100%);
    display: flex;
    flex-direction: column;
    padding: clamp(1.6rem, 3.2vw, 3rem) clamp(1.6rem, 4vw, 3.6rem);
    isolation: isolate;
}
.auth-stage::before {
    /* faint survey grid, like a control-room map */
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-image:
        linear-gradient(rgba(233,238,246,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(233,238,246,.045) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(120% 90% at 70% 70%, #000 30%, transparent 75%);
            mask-image: radial-gradient(120% 90% at 70% 70%, #000 30%, transparent 75%);
}

.auth-brand { display: inline-flex; align-items: center; gap: .8rem; color: #fff; text-decoration: none; }
.auth-brand svg { width: 48px; height: 48px; color: #fff; }
.auth-brand-name { font-family: var(--sw-font-display); font-size: 1.22rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.auth-brand-sub { font-size: .76rem; font-weight: 500; color: rgba(233,238,246,.62); margin-top: .28rem; }

.auth-pitch { margin-top: auto; max-width: 560px; position: relative; z-index: 2; }
.auth-pitch h1 {
    font-family: var(--sw-font-display);
    font-size: clamp(2rem, 3.6vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -.024em;
    line-height: 1.04;
    color: #fff;
    margin: 0 0 1rem;
}
.auth-pitch p { font-size: 1.02rem; line-height: 1.6; color: rgba(233,238,246,.74); max-width: 470px; margin: 0; }

.auth-facts { list-style: none; padding: 0; margin: 1.8rem 0 0; display: grid; gap: .7rem; }
.auth-facts li { display: flex; align-items: center; gap: .75rem; font-size: .9rem; color: rgba(233,238,246,.86); }
.auth-facts i {
    width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); color: #9fb0e6; font-size: 1rem;
}

.auth-stage-foot {
    margin-top: 2.2rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    position: relative; z-index: 2;
}
.auth-clock { font-family: var(--sw-font-display); line-height: 1; }
.auth-clock-time { font-size: 2.4rem; font-weight: 700; letter-spacing: -.03em; color: #fff; font-variant-numeric: tabular-nums; }
.auth-clock-date { font-size: .8rem; color: rgba(233,238,246,.6); margin-top: .4rem; }
.auth-status { display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem; color: rgba(233,238,246,.78); }
.auth-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #25b87d; box-shadow: 0 0 0 0 rgba(37,184,125,.55); animation: auth-ping 2.2s ease-out infinite; }
@keyframes auth-ping { 0% { box-shadow: 0 0 0 0 rgba(37,184,125,.55); } 80%, 100% { box-shadow: 0 0 0 10px rgba(37,184,125,0); } }

/* Orbit system — the signature */
.auth-orbit {
    position: absolute; z-index: 0; pointer-events: none;
    right: -16%; top: 4%;
    width: min(760px, 92%); aspect-ratio: 1 / 1;
    opacity: .95;
}
.auth-orbit .ring { fill: none; stroke: rgba(159,176,230,.22); stroke-width: 1; }
.auth-orbit .ring.strong { stroke: rgba(159,176,230,.38); stroke-width: 1.4; }
.auth-orbit .ring.dash { stroke-dasharray: 2 7; stroke: rgba(233,238,246,.22); }
.auth-orbit .core { fill: rgba(93,107,169,.16); stroke: rgba(159,176,230,.3); }
.auth-orbit .node { fill: #5D6BA9; }
.auth-orbit .node.navy { fill: #8a96d0; }
.auth-orbit .node.ok { fill: #25b87d; }
.auth-orbit .halo { fill: none; stroke: #25b87d; stroke-width: 1.2; opacity: 0; transform-box: fill-box; transform-origin: center; animation: auth-halo 3.2s ease-out infinite; }
.auth-orbit .halo.d2 { animation-delay: 1.1s; }
.auth-orbit .halo.d3 { animation-delay: 2.2s; }
@keyframes auth-halo { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(3.2); } }
.auth-orbit .sweep { transform-origin: 400px 400px; animation: auth-sweep 14s linear infinite; }
@keyframes auth-sweep { to { transform: rotate(360deg); } }

/* ---------- Panel (right, paper) ---------- */
.auth-panel {
    position: relative;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: clamp(1.4rem, 4vw, 3rem) clamp(1.1rem, 4vw, 3.2rem) 1.4rem;
    background:
        radial-gradient(700px 400px at 100% 0%, rgba(93,107,169,.10), rgba(93,107,169,0) 60%),
        var(--sw-paper-2);
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card-mobile-brand { display: none; }

.auth-eyebrow { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 600; color: var(--sw-blue); margin-bottom: .7rem; }
.auth-title { font-family: var(--sw-font-display); font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; margin: 0 0 .45rem; color: var(--sw-ink); }
.auth-lead { color: var(--sw-text-2); font-size: .95rem; line-height: 1.55; margin: 0 0 1.6rem; }

.auth-field { margin-bottom: 1rem; }
.auth-field label { display: flex; justify-content: space-between; align-items: baseline; font-size: .82rem; font-weight: 600; color: var(--sw-text-2); margin-bottom: .4rem; }
.auth-input { position: relative; }
.auth-input > i.lead-icon { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: #8d9ab0; font-size: 1.05rem; pointer-events: none; transition: color .15s ease; }
html body .auth-input .form-control {
    height: 52px; padding-left: 2.75rem; padding-right: 3rem;
    border-radius: 13px; border: 1px solid rgba(0,20,51,.14); background: #fff;
    font-size: .98rem; font-weight: 500; color: var(--sw-ink);
    box-shadow: 0 1px 2px rgba(0,20,51,.04);
}
html body .auth-input .form-control:focus { border-color: var(--sw-blue); box-shadow: 0 0 0 4px rgba(93,107,169,.16); }
.auth-input:focus-within > i.lead-icon { color: var(--sw-navy); }
.auth-eye {
    position: absolute; right: .45rem; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent;
    color: #6b7a93; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.auth-eye:hover { background: var(--sw-blue-soft); color: var(--sw-navy); }
.auth-caps { display: none; align-items: center; gap: .35rem; margin-top: .45rem; font-size: .78rem; font-weight: 600; color: #a8660a; }
.auth-caps.show { display: flex; }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: .3rem 0 1.3rem; flex-wrap: wrap; }
.auth-row .form-check-label { font-size: .86rem; color: var(--sw-text-2); }
.auth-link { font-size: .86rem; font-weight: 600; color: var(--sw-navy); background: none; border: 0; padding: 0; text-decoration: none; }
.auth-link:hover { color: var(--sw-blue); text-decoration: underline; text-underline-offset: 3px; }

.auth-submit {
    width: 100%; height: 52px; border: 0; border-radius: 13px;
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    font-weight: 700; font-size: 1rem; color: #fff; letter-spacing: -.005em;
    background: var(--sw-grad-green);
    box-shadow: 0 10px 24px rgba(31,157,107,.30), inset 0 1px 0 rgba(255,255,255,.18);
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}
.auth-submit:hover { filter: brightness(1.06); box-shadow: 0 14px 30px rgba(31,157,107,.38), inset 0 1px 0 rgba(255,255,255,.18); color: #fff; }
.auth-submit:active { transform: translateY(1px); }
.auth-submit.secondary { background: linear-gradient(180deg, #2f3478, #282C68); box-shadow: 0 10px 24px rgba(40,44,104,.28); }
.auth-submit.is-loading { pointer-events: none; filter: saturate(.8); }
.auth-submit .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); border-right-color: transparent; animation: sg-rot .7s linear infinite; display: none; }
.auth-submit.is-loading .spin { display: inline-block; }
.auth-submit.is-loading .lbl-idle { display: none; }
.auth-submit .lbl-busy { display: none; }
.auth-submit.is-loading .lbl-busy { display: inline; }
@keyframes sg-rot { to { transform: rotate(360deg); } }

.auth-alert {
    display: flex; gap: .7rem; align-items: flex-start;
    border-radius: 13px; padding: .8rem .9rem; margin-bottom: 1.2rem; font-size: .88rem; line-height: 1.45;
    border: 1px solid; animation: auth-shake .42s cubic-bezier(.36,.07,.19,.97) both;
}
.auth-alert i { font-size: 1.1rem; margin-top: .05rem; }
.auth-alert.error { background: var(--sw-red-soft); border-color: rgba(217,56,74,.25); color: #8e1f2e; }
.auth-alert.ok { background: var(--sw-green-soft); border-color: rgba(31,157,107,.25); color: #145f43; animation: none; }
.auth-alert.info { background: var(--sw-blue-soft); border-color: var(--sw-blue-soft-2); color: var(--sw-navy); animation: none; }
@keyframes auth-shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }

.auth-meta { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--sw-line); display: flex; gap: .6rem; align-items: center; color: var(--sw-text-3); font-size: .8rem; }
.auth-meta i { color: var(--sw-green); }

.auth-statusbox { display: flex; gap: .85rem; align-items: center; padding: 1rem; border-radius: 15px; background: #fff; border: 1px solid var(--sw-line); box-shadow: var(--sw-shadow-2); margin-bottom: 1.2rem; }
.auth-statusbox .ico { width: 46px; height: 46px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; flex: 0 0 auto; background: var(--sw-blue-soft); color: var(--sw-navy); }
.auth-statusbox .ico.ok { background: var(--sw-green-soft); color: var(--sw-green-lo); }
.auth-statusbox .ico.bad { background: var(--sw-red-soft); color: var(--sw-red); }
.auth-statusbox strong { display: block; font-size: .92rem; color: var(--sw-ink); }
.auth-statusbox span { font-size: .82rem; color: var(--sw-text-3); }

.auth-strength { display: flex; gap: 4px; margin-top: .5rem; }
.auth-strength span { flex: 1; height: 4px; border-radius: 4px; background: var(--sw-paper-3); transition: background .2s ease; }
.auth-strength[data-score="1"] span:nth-child(-n+1) { background: var(--sw-red); }
.auth-strength[data-score="2"] span:nth-child(-n+2) { background: #e9a23b; }
.auth-strength[data-score="3"] span:nth-child(-n+3) { background: var(--sw-blue); }
.auth-strength[data-score="4"] span:nth-child(-n+4) { background: var(--sw-green); }
.auth-strength-label { font-size: .76rem; color: var(--sw-text-3); margin-top: .3rem; min-height: 1em; }

.auth-powered {
    margin-top: auto; padding-top: 2rem; width: 100%; max-width: 420px;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    font-size: .76rem; color: var(--sw-text-3);
}
.auth-powered a { color: var(--sw-text-2); text-decoration: none; display: inline-flex; align-items: center; gap: .55rem; }
.auth-powered img { height: 34px; width: auto; }
.auth-powered a:hover { color: var(--sw-navy); }

html body.sg-auth .field-validation-error { display: block; margin-top: .35rem; }

/* entrance: one orchestrated moment */
.auth-pitch, .auth-card { animation: auth-in .7s cubic-bezier(.2,.7,.2,1) both; }
.auth-card { animation-delay: .08s; }
@keyframes auth-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-stage { display: none; }
    .auth-card-mobile-brand {
        display: flex; align-items: center; gap: .7rem; margin-bottom: 1.6rem;
        padding: .8rem .95rem; border-radius: 16px; color: #fff; background: var(--sw-grad-navy);
        box-shadow: 0 14px 30px rgba(0,20,51,.18);
    }
    .auth-card-mobile-brand svg { width: 40px; height: 40px; color: #fff; }
    .auth-card-mobile-brand b { font-family: var(--sw-font-display); font-size: 1.05rem; display: block; line-height: 1.1; }
    .auth-card-mobile-brand small { color: rgba(233,238,246,.7); font-size: .74rem; }
    .auth-panel { justify-content: flex-start; padding-top: 1.4rem; }
}
@media (max-width: 420px) { .auth-title { font-size: 1.7rem; } }
@media (prefers-reduced-motion: reduce) {
    .auth-orbit .sweep, .auth-orbit .halo, .auth-status-dot, .auth-pitch, .auth-card, .auth-alert { animation: none !important; }
}
