/* ===========================================================================
 * xims-login.css
 * Sign-in page.
 *
 * Namespace .xl-* (XIMS login). Self-contained - deliberately does not depend
 * on the app shell stylesheet, because this page renders before the shell.
 * =========================================================================== */

:root {
    --xl-ink:        #0A1428;
    --xl-ink-deep:   #060D18;
    --xl-ink-soft:   #12233E;
    --xl-wire:       #1B3255;
    --xl-signal:     #2DD4A7;
    --xl-signal-dim: #1B8F72;
    --xl-paper:      #FFFFFF;
    --xl-carbon:     #0A1428;
    --xl-slate:      #54657F;
    --xl-mist:       #E4E9F0;
    --xl-alarm:      #E5484D;
    --xl-hold:       #E8A33D;

    --xl-sans: 'Segoe UI Variable Display', 'Segoe UI', -apple-system,
               BlinkMacSystemFont, system-ui, sans-serif;
    --xl-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code',
               Consolas, Menlo, monospace;
}

/* ---- Reset local to this page ------------------------------------------- */
.xl-root *,
.xl-root *::before,
.xl-root *::after { box-sizing: border-box; }

html, body { height: 100%; }

.xl-root {
    min-height: 100vh;
    margin: 0;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    font-family: var(--xl-sans);
    color: var(--xl-carbon);
    background: var(--xl-paper);
    -webkit-font-smoothing: antialiased;
}

/* =======================================================================
   LEFT - the ink panel
   ======================================================================= */

.xl-stage {
    position: relative;
    background:
        radial-gradient(120% 90% at 12% 8%, #14294A 0%, transparent 55%),
        linear-gradient(155deg, var(--xl-ink) 0%, var(--xl-ink-deep) 100%);
    color: #fff;
    padding: 44px 52px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Faint engineering grid, so the panel reads as a technical surface. */
.xl-stage::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
    background-size: 56px 56px;
    pointer-events: none;
}

.xl-stage > * { position: relative; }

/* ---- Brand -------------------------------------------------------------- */
.xl-brand {
    display: flex; align-items: center; gap: 11px;
    margin-bottom: auto;
}
.xl-brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(140deg, var(--xl-signal), var(--xl-signal-dim));
    color: var(--xl-ink-deep);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; letter-spacing: -.02em;
    flex-shrink: 0;
}
.xl-brand-name {
    font-size: 17px; font-weight: 700; letter-spacing: .01em; color: #fff;
}

/* ---- The signature: address-space grid ---------------------------------- */
.xl-panel-body { padding: 40px 0; }

.xl-eyebrow {
    font-family: var(--xl-mono);
    font-size: 10.5px; font-weight: 600;
    letter-spacing: .19em; text-transform: uppercase;
    color: var(--xl-signal);
    margin-bottom: 18px;
}

.xl-grid {
    display: grid;
    grid-template-columns: repeat(28, 1fr);
    gap: 3px;
    max-width: 520px;
    margin-bottom: 26px;
}
.xl-cell {
    aspect-ratio: 1;
    border-radius: 2px;
    background: var(--xl-wire);
    transition: background-color .55s ease;
}
/* Deliberately muted. Full-strength mint is reserved for the submit button -
   if the grid used it too, the primary action would lose its primacy. */
.xl-cell.is-assigned  { background: rgba(45, 212, 167, .40); }
.xl-cell.is-reserved  { background: rgba(45, 212, 167, .17); }
.xl-cell.is-held      { background: rgba(232, 163, 61, .42); }
.xl-cell.is-free      { background: rgba(255, 255, 255, .045); }

.xl-headline {
    font-size: 27px; font-weight: 650; line-height: 1.28;
    letter-spacing: -.022em;
    max-width: 520px;
    margin: 0 0 12px;
    text-wrap: balance;
    color: #fff;
}
.xl-sub {
    font-size: 14px; line-height: 1.6;
    color: rgba(255,255,255,.6);
    max-width: 470px;
    margin: 0 0 28px;
}

/* ---- Legend - doubles as the grid's key --------------------------------- */
.xl-legend {
    display: flex; flex-wrap: wrap; gap: 18px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.09);
    max-width: 520px;
}
.xl-legend-item {
    display: flex; align-items: center; gap: 7px;
    font-family: var(--xl-mono);
    font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
    color: rgba(255,255,255,.52);
}
.xl-swatch {
    width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0;
}
.xl-swatch-assigned { background: rgba(45, 212, 167, .70); }
.xl-swatch-reserved { background: rgba(45, 212, 167, .30); }
.xl-swatch-held     { background: rgba(232, 163, 61, .60); }
.xl-swatch-free     { background: rgba(255, 255, 255, .16); }

.xl-stage-foot {
    margin-top: auto;
    font-family: var(--xl-mono);
    font-size: 10.5px; letter-spacing: .08em;
    color: rgba(255,255,255,.3);
}

/* =======================================================================
   RIGHT - the form panel
   ======================================================================= */

.xl-panel {
    display: flex; align-items: center; justify-content: center;
    padding: 44px 40px;
}
.xl-form-wrap { width: 100%; max-width: 372px; }

.xl-h1 {
    font-size: 27px; font-weight: 650; letter-spacing: -.024em;
    margin: 0 0 6px; color: var(--xl-carbon);
}
.xl-lede {
    font-size: 14px; color: var(--xl-slate);
    margin: 0 0 30px; line-height: 1.55;
}

/* ---- Fields ------------------------------------------------------------- */
.xl-field { margin-bottom: 17px; }

/* Label ABOVE the control. The previous build had these inverted. */
.xl-label {
    display: block;
    font-size: 12.5px; font-weight: 600;
    color: var(--xl-carbon);
    margin-bottom: 7px;
    letter-spacing: -.005em;
}

.xl-input {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--xl-carbon);
    background: #fff;
    border: 1px solid var(--xl-mist);
    border-radius: 9px;
    outline: none;
    transition: border-color .14s, box-shadow .14s, background-color .14s;
}
.xl-input::placeholder { color: #A6B2C4; }
.xl-input:hover { border-color: #CBD4E1; }
.xl-input:focus {
    border-color: var(--xl-signal-dim);
    box-shadow: 0 0 0 3.5px rgba(45, 212, 167, .17);
}
.xl-input[aria-invalid="true"] {
    border-color: var(--xl-alarm);
    background: #FFF7F7;
}

/* Password field with a reveal control */
.xl-input-group { position: relative; }
.xl-input-group .xl-input { padding-right: 46px; }
.xl-reveal {
    position: absolute; top: 0; right: 0;
    width: 44px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 0; cursor: pointer;
    color: #93A1B5; border-radius: 0 9px 9px 0;
    transition: color .14s;
}
.xl-reveal:hover { color: var(--xl-carbon); }
.xl-reveal:focus-visible {
    outline: 2px solid var(--xl-signal-dim); outline-offset: -2px;
}
/* Inline SVG, not an icon font: a font that fails to load would leave this
   functional control invisible and zero-width. */
.xl-reveal svg { width: 17px; height: 17px; display: block; }

/* ---- Row: keep signed in + forgot --------------------------------------- */
.xl-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    margin: 20px 0 22px;
}
.xl-check {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--xl-slate);
    cursor: pointer; user-select: none;
}
.xl-check input {
    width: 16px; height: 16px; margin: 0;
    accent-color: var(--xl-signal-dim);
    cursor: pointer; flex-shrink: 0;
}
.xl-link {
    font-size: 13px; font-weight: 500;
    color: var(--xl-signal-dim); text-decoration: none;
}
.xl-link:hover { text-decoration: underline; }

/* ---- Submit ------------------------------------------------------------- */
.xl-submit {
    width: 100%; height: 46px;
    display: flex; align-items: center; justify-content: center; gap: 9px;
    font-family: inherit; font-size: 14.5px; font-weight: 600;
    color: var(--xl-ink-deep);
    background: var(--xl-signal);
    border: 0; border-radius: 9px;
    cursor: pointer;
    transition: background-color .14s, transform .06s;
}
.xl-submit:hover { background: #3FE0B5; }
.xl-submit:active { transform: translateY(1px); }
.xl-submit:focus-visible {
    outline: 2px solid var(--xl-ink); outline-offset: 2px;
}
.xl-submit[disabled] { opacity: .6; cursor: progress; }

.xl-spinner {
    width: 15px; height: 15px;
    border: 2px solid rgba(6,13,24,.28);
    border-top-color: var(--xl-ink-deep);
    border-radius: 50%;
    animation: xl-spin .6s linear infinite;
}
@keyframes xl-spin { to { transform: rotate(360deg); } }

/* ---- Messages ----------------------------------------------------------- */
.xl-alert {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 13px; line-height: 1.5;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.xl-alert svg { flex-shrink: 0; margin-top: 1px; width: 16px; height: 16px; }
.xl-alert-error { background: #FFF1F1; color: #A31B1F; border-color: #F7CFD0; }
.xl-alert-info  { background: #EFFBF7; color: #14795F; border-color: #C3EFE2; }

/* ---- Foot --------------------------------------------------------------- */
.xl-foot {
    margin-top: 30px; padding-top: 20px;
    border-top: 1px solid var(--xl-mist);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    font-size: 11.5px; color: #8494A8;
}
.xl-foot-mono { font-family: var(--xl-mono); letter-spacing: .06em; }

/* =======================================================================
   Entrance - one orchestrated sequence, not scattered effects
   ======================================================================= */
.xl-rise { animation: xl-rise .5s cubic-bezier(.2,.7,.3,1) backwards; }
.xl-d1 { animation-delay: .04s; }
.xl-d2 { animation-delay: .10s; }
.xl-d3 { animation-delay: .16s; }
@keyframes xl-rise {
    from { opacity: 0; transform: translateY(9px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .xl-rise { animation: none; }
    .xl-cell { transition: none; }
    .xl-spinner { animation-duration: 2s; }
}

/* =======================================================================
   Responsive - the ink panel is the first thing to go
   ======================================================================= */
@media (max-width: 1100px) {
    .xl-root { grid-template-columns: 1fr 1fr; }
    .xl-stage { padding: 36px 38px; }
    .xl-grid { gap: 2.5px; }
    .xl-headline { font-size: 23px; }
}

@media (max-width: 880px) {
    .xl-root { grid-template-columns: 1fr; }
    .xl-stage {
        padding: 26px 28px 30px;
        min-height: auto;
    }
    .xl-panel-body { padding: 26px 0 20px; }
    .xl-grid { gap: 2.5px; max-width: none; }
    .xl-headline { font-size: 21px; max-width: none; }
    .xl-sub { margin-bottom: 20px; max-width: none; }
    .xl-legend { max-width: none; }
    .xl-stage-foot { display: none; }
    .xl-panel { padding: 34px 28px 48px; }
}

@media (max-width: 480px) {
    .xl-stage { padding: 22px 20px 26px; }
    .xl-grid { gap: 2px; }
    .xl-legend { gap: 12px; }
    .xl-panel { padding: 28px 20px 40px; }
    .xl-h1 { font-size: 24px; }
    .xl-row { flex-direction: column; align-items: flex-start; gap: 12px; }
}
