/* ===========================================================================
   Light Bridges IdP theme — SimpleSAMLphp 2.x
   Single stylesheet for: login, consent, error pages.
   Variant: V2 "Split horizon" (left brand panel + right form panel)
   ===========================================================================
   Color & type tokens
   --------------------------------------------------------------------------- */
:root {
    --lb-navy-950: #0A1426;
    --lb-navy-900: #0F172A;
    --lb-navy-800: #1E293B;
    --lb-navy-700: #334155;

    --lb-gold-500: #E5B53C;
    --lb-gold-400: #EFC861;
    --lb-gold-600: #C99A26;

    --lb-white:    #FFFFFF;
    --lb-paper:    #FAFAF7;
    --lb-slate-100:#F1F5F9;
    --lb-slate-200:#E2E8F0;
    --lb-slate-300:#CBD5E1;
    --lb-slate-400:#94A3B8;
    --lb-slate-500:#64748B;
    --lb-slate-600:#475569;

    --lb-error:    #DC2626;
    --lb-error-bg: #FEF2F2;
    --lb-success:  #22C55E;

    --lb-font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --lb-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: var(--lb-font-sans);
    color: var(--lb-navy-900);
    background: var(--lb-paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--lb-navy-700); }

img { max-width: 100%; height: auto; }

/* ---------------------------------------------------------------------------
   Shell — split horizon
   --------------------------------------------------------------------------- */
.lb-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, 1fr) 1.15fr;
}

/* ---------------------------------------------------------------------------
   LEFT — brand panel
   --------------------------------------------------------------------------- */
.lb-brand {
    position: relative;
    padding: 44px 48px;
    background: linear-gradient(180deg, var(--lb-navy-900) 0%, var(--lb-navy-950) 100%);
    color: var(--lb-slate-200);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lb-brand::before {
    /* faint nebular wash */
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 70% 10%, rgba(229,181,60,0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 10% 90%, rgba(30,58,138,0.30) 0%, transparent 55%);
    pointer-events: none;
}

.lb-brand__top, .lb-brand__center, .lb-brand__bottom { position: relative; z-index: 1; }

.lb-brand__logo { width: 200px; height: auto; filter: brightness(0) invert(1); }

.lb-brand__center {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 460px;
    padding: 40px 0;
}

.lb-kicker {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--lb-gold-500);
    font-weight: 500;
}

.lb-brand__headline {
    margin: 16px 0 24px;
    font-size: 56px;
    line-height: 1.02;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--lb-white);
}

.lb-brand__italic { font-style: italic; font-weight: 400; color: var(--lb-slate-300); }
.lb-brand__dot { color: var(--lb-gold-500); }

.lb-brand__lead {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
    color: var(--lb-slate-400);
    max-width: 380px;
}

.lb-brand__bottom { flex: 0 0 auto; display: flex; flex-direction: column; gap: 10px; }

.lb-status { display: flex; align-items: center; gap: 10px; }
.lb-status__dot {
    width: 8px; height: 8px; border-radius: 999px;
    background: var(--lb-success);
    box-shadow: 0 0 0 4px rgba(34,197,94,0.15);
}
.lb-status__label { font-size: 12px; color: var(--lb-slate-300); }

.lb-coords {
    display: flex; flex-wrap: wrap; gap: 8px;
    font-family: var(--lb-font-mono);
    font-size: 11px;
    color: var(--lb-slate-600);
    letter-spacing: 0.02em;
}
.lb-coords__sep { color: var(--lb-navy-700); }

.lb-brand__mark { position: absolute; top: 36px; right: 36px; opacity: 0.9; z-index: 1; }

/* ---------------------------------------------------------------------------
   RIGHT — content panel
   --------------------------------------------------------------------------- */
.lb-main {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--lb-paper);
    min-width: 0;
}

.lb-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 48px 0;
}

.lb-topbar__home { display: inline-flex; }
/* The top-bar logo on the light side: hide if you only want it in the brand panel.
   Here we render it darker via filter — but on the white right panel we just hide
   it because the wordmark is white. We hide it on screens wide enough to show
   the brand panel; show on narrow layouts where the brand panel collapses. */
.lb-topbar__home img { width: 0; height: 0; visibility: hidden; }

.lb-lang {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--lb-white);
    border: 1px solid var(--lb-slate-200);
    border-radius: 999px;
}

.lb-lang__btn {
    background: transparent;
    border: 0;
    padding: 6px 12px;
    border-radius: 999px;
    font: 500 12px/1 var(--lb-font-sans);
    color: var(--lb-slate-500);
    letter-spacing: 0.06em;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.lb-lang__btn:hover { color: var(--lb-navy-900); }
.lb-lang__btn--active { background: var(--lb-navy-900); color: var(--lb-gold-500); }

/* ---------------------------------------------------------------------------
   Content + forms
   --------------------------------------------------------------------------- */
.lb-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lb-form-wrap {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 32px 48px;
}
.lb-form-wrap--wide { max-width: 680px; }

.lb-kicker--muted { color: var(--lb-slate-400); letter-spacing: 0.22em; }
.lb-kicker--error { color: var(--lb-error); letter-spacing: 0.22em; }

.lb-h1 {
    margin: 10px 0 8px;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--lb-navy-900);
    line-height: 1.15;
}
.lb-form-wrap--wide .lb-h1 { font-size: 26px; font-weight: 500; }

.lb-sp-name {
    font-weight: 600;
    color: var(--lb-navy-900);
    border-bottom: 2px solid var(--lb-gold-500);
    padding-bottom: 1px;
}

.lb-sub {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--lb-slate-500);
}

.lb-form { display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }
.lb-form--consent { margin-top: 20px; }

.lb-form__row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin-top: 2px;
}

.lb-field { display: flex; flex-direction: column; gap: 6px; }
.lb-field__label { font-size: 12px; font-weight: 500; color: var(--lb-slate-600); }
.lb-field__input {
    height: 46px;
    padding: 0 14px;
    font-family: var(--lb-font-sans);
    font-size: 14px;
    color: var(--lb-navy-900);
    background: var(--lb-white);
    border: 1px solid var(--lb-slate-300);
    border-radius: 6px;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.lb-field__input:focus {
    border-color: var(--lb-navy-900);
    box-shadow: 0 0 0 3px rgba(229,181,60,0.25);
}
.lb-field__input[readonly] { background: var(--lb-slate-100); color: var(--lb-slate-500); }

/* Checkbox */
.lb-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--lb-slate-600);
    cursor: pointer;
    user-select: none;
}
.lb-checkbox input { accent-color: var(--lb-navy-900); width: 16px; height: 16px; }
.lb-checkbox--remember { margin-top: 18px; }

/* Buttons */
.lb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 22px;
    font: 600 13px/1 var(--lb-font-sans);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 80ms ease, background 120ms ease, color 120ms ease;
}
.lb-btn:active { transform: translateY(1px); }

.lb-btn--primary {
    background: var(--lb-navy-900);
    color: var(--lb-gold-500);
    border-color: var(--lb-navy-900);
}
.lb-btn--primary:hover { background: #050B17; }

.lb-btn--ghost {
    background: transparent;
    color: var(--lb-slate-600);
    border-color: var(--lb-slate-300);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}
.lb-btn--ghost:hover { border-color: var(--lb-slate-500); color: var(--lb-navy-900); }

.lb-btn--block { width: 100%; }

/* Alerts */
.lb-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 6px;
    margin: 20px 0 0;
    font-size: 13px;
    line-height: 1.5;
}
.lb-alert--error {
    background: var(--lb-error-bg);
    color: #991B1B;
    border: 1px solid #FCA5A5;
}
.lb-alert svg { flex-shrink: 0; margin-top: 1px; }

/* Meta (entityID strip) */
.lb-meta {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--lb-slate-200);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lb-meta__row { display: flex; flex-direction: column; gap: 2px; }
.lb-meta__label {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--lb-slate-400);
    font-weight: 500;
}
.lb-meta__value {
    font-family: var(--lb-font-mono);
    font-size: 11px;
    color: var(--lb-slate-600);
    word-break: break-all;
}

/* Footer */
.lb-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 48px 28px;
    font-size: 11px;
    color: var(--lb-slate-500);
}
.lb-footer a { color: var(--lb-slate-600); text-decoration: none; border-bottom: 1px dotted var(--lb-slate-400); }
.lb-footer__build { margin-left: auto; color: var(--lb-slate-400); font-family: var(--lb-font-mono); }

/* ---------------------------------------------------------------------------
   Consent — SP card + attribute table
   --------------------------------------------------------------------------- */
.lb-sp-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--lb-paper);
    border: 1px solid var(--lb-slate-200);
    border-radius: 8px;
    margin: 24px 0;
}
.lb-sp-card__icon {
    width: 40px; height: 40px; border-radius: 8px;
    background: var(--lb-white);
    border: 1px solid var(--lb-slate-200);
    display: grid; place-items: center;
    flex: 0 0 auto;
}
.lb-sp-card__icon--dark { background: var(--lb-navy-900); border-color: var(--lb-navy-900); }
.lb-sp-card__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lb-sp-card__label {
    font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--lb-slate-400); font-weight: 500;
}
.lb-sp-card__domain { font-family: var(--lb-font-mono); font-size: 13px; color: var(--lb-navy-900); }
.lb-sp-card__entityid { font-family: var(--lb-font-mono); font-size: 11px; color: var(--lb-slate-500); word-break: break-all; }
.lb-sp-card__arrow { color: var(--lb-slate-400); font-size: 18px; }

.lb-attr { margin-top: 4px; }
.lb-attr__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 8px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--lb-navy-900);
}
.lb-attr__count { font-family: var(--lb-font-mono); font-size: 11px; color: var(--lb-slate-400); font-weight: 400; }
.lb-attr__list { display: flex; flex-direction: column; }
.lb-attr__row {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid var(--lb-slate-100);
    font-size: 13px;
    line-height: 1.5;
    align-items: start;
}
.lb-attr__key {
    color: var(--lb-navy-900);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lb-attr__key-tech { font-family: var(--lb-font-mono); font-size: 10px; color: var(--lb-slate-400); word-break: break-all; }
.lb-attr__value { color: var(--lb-navy-900); word-break: break-word; }
.lb-attr__value-line { display: block; }

.lb-privacy-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--lb-slate-500);
    margin: 10px 0 0;
}
.lb-privacy-note a { color: var(--lb-slate-600); }

.lb-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

/* ---------------------------------------------------------------------------
   Error page extras
   --------------------------------------------------------------------------- */
.lb-error-icon {
    width: 56px; height: 56px; border-radius: 999px;
    background: var(--lb-error-bg);
    border: 1px solid #FCA5A5;
    display: grid; place-items: center;
    margin-bottom: 20px;
}

.lb-codeblock {
    margin-top: 22px;
    padding: 12px 14px;
    background: var(--lb-paper);
    border: 1px solid var(--lb-slate-200);
    border-radius: 6px;
    display: flex; flex-direction: column; gap: 6px;
}
.lb-codeblock__row {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 16px; flex-wrap: wrap;
}
.lb-codeblock__label { font-size: 11px; color: var(--lb-slate-400); letter-spacing: 0.04em; }
.lb-codeblock__value { font-family: var(--lb-font-mono); font-size: 11px; color: var(--lb-navy-900); text-align: right; word-break: break-all; }

.lb-stacktrace {
    margin-top: 18px;
    padding: 10px 14px;
    background: var(--lb-slate-100);
    border-radius: 6px;
    font-size: 12px;
    color: var(--lb-slate-600);
}
.lb-stacktrace summary { cursor: pointer; user-select: none; font-weight: 500; }
.lb-stacktrace__msg { font-family: var(--lb-font-mono); margin: 8px 0; color: var(--lb-error); }
.lb-stacktrace__trace {
    font-family: var(--lb-font-mono);
    font-size: 11px;
    overflow: auto;
    background: #FFFFFF;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--lb-slate-200);
}

/* ---------------------------------------------------------------------------
   Responsive — collapse brand panel on narrow screens
   --------------------------------------------------------------------------- */
@media (max-width: 880px) {
    .lb-shell { grid-template-columns: 1fr; }
    .lb-brand { padding: 24px 28px; min-height: 200px; }
    .lb-brand__headline { font-size: 36px; margin: 12px 0 14px; }
    .lb-brand__lead { display: none; }
    .lb-brand__center { padding: 16px 0; }
    .lb-brand__mark { display: none; }
    .lb-coords { font-size: 10px; }

    .lb-topbar { padding: 20px 24px 0; }
    .lb-topbar__home img {
        width: 140px; height: auto; visibility: visible;
        /* the wordmark is white, so we hide on light bg via filter inversion:
           safer to keep brand-panel-only and rely on it for identity */
        display: none;
    }
    .lb-form-wrap, .lb-form-wrap--wide { padding: 24px; max-width: 100%; }
    .lb-footer { padding: 16px 24px 20px; flex-wrap: wrap; }
    .lb-footer__build { margin-left: 0; flex-basis: 100%; }

    .lb-attr__row { grid-template-columns: 1fr; gap: 4px; }
    .lb-sp-card { flex-wrap: wrap; }
    .lb-actions { flex-direction: column-reverse; }
    .lb-actions .lb-btn { width: 100%; }
}

/* ---------------------------------------------------------------------------
   Print — clean monochrome for screenshot debugging
   --------------------------------------------------------------------------- */
@media print {
    .lb-brand, .lb-lang, .lb-actions { display: none; }
    .lb-shell { grid-template-columns: 1fr; }
    body { background: #fff; }
}
