/* =========================================================================
   Teleoutlet hosted screens: BankID sign-in (oidc/*) and trade-in (pant/*).

   Brand cues from teleoutlet.no: navy #09284e, mint #9feeac, grey input
   fields #f3f5f6, Barlow, 5px corners. One loud element per flow (the offer
   card on pant/offer); everything else stays quiet.

   Component classes are scoped under .oidc-screen: names like .card, .cta
   and .field are generic and would collide elsewhere.
   ========================================================================= */

:root {
    --navy: #09284e;
    --navy-600: #1b3d68;
    --mint: #9feeac;
    --mint-soft: #e6f9ea;
    --mint-ink: #146c2e;
    --surface: #f3f5f6;
    --line: #e1e3e4;
    --line-strong: #c4c9cc;
    --ink: #282828;
    --muted: #5d676e;
    --danger: #c0262d;
    --danger-soft: #fdeeee;
    --warn: #ffbd00;
    --warn-soft: #fff6dc;
    --warn-ink: #5c4300;
    --radius: 5px;
    --radius-card: 8px;
    --font: "Barlow", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

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

body,
.oidc-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

/* ---- Shell ------------------------------------------------------------- */

.oidc-header { background: var(--navy); color: #ffffff; }
.oidc-header-inner {
    max-width: 480px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.oidc-wordmark { font-weight: 700; font-size: 22px; letter-spacing: -0.02em; color: #ffffff; text-decoration: none; }
.oidc-secure { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #cfd7e3; }
.oidc-secure svg { color: var(--mint); }

.oidc-main { flex-grow: 1; display: flex; padding: 20px 16px 40px; }
.oidc-main > .oidc-screen { flex-grow: 1; }

/* ---- Screen ------------------------------------------------------------ */

.oidc-screen {
    display: flex;
    flex-direction: column;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

.oidc-screen .page-title {
    font-weight: 700;
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--navy);
    margin: 0 0 8px;
    text-wrap: balance;
}

.oidc-screen .lede { font-size: 16px; color: var(--muted); line-height: 1.55; margin: 0; text-wrap: pretty; }

.oidc-screen .section-title { font-size: 17px; font-weight: 600; color: var(--navy); margin: 0 0 4px; }
.oidc-screen .section-title + .hint { margin: 0; }

.oidc-screen .oidc-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 20px;
}
.oidc-screen .oidc-card + .oidc-card { margin-top: 12px; }
.oidc-screen dl.oidc-card { margin-bottom: 0; }

/* ---- Fields ------------------------------------------------------------ */

.oidc-screen .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.oidc-screen .field .lbl,
.oidc-screen legend.lbl { font-size: 15px; font-weight: 600; color: var(--ink); padding: 0; }
.oidc-screen fieldset.field { border: 0; padding: 0; margin-inline: 0; }
.oidc-screen fieldset.field legend { margin-bottom: 6px; }

.oidc-screen .oidc-input {
    width: 100%;
    font: inherit;
    font-size: 17px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid transparent;
    border-bottom-color: var(--line-strong);
    border-radius: var(--radius);
    padding: 13px 14px;
    transition: border-color .15s, background-color .15s;
}
.oidc-screen .oidc-input::placeholder { color: #8d969c; }
.oidc-screen .oidc-input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(9, 40, 78, .15);
}
.oidc-screen .oidc-input--error { border-color: var(--danger); background: var(--danger-soft); }

.oidc-screen select.oidc-input {
    appearance: none;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2309284e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

/* One wide field rather than six boxes: paste and one-time-code autofill keep
   working, and the layout cannot jump between states. */
.oidc-screen .oidc-input--code {
    font-weight: 700;
    font-size: 30px;
    text-align: center;
    letter-spacing: 0.5em;
    padding: 16px 16px 16px 32px;
    font-variant-numeric: tabular-nums;
}

.oidc-screen .field-grid { display: grid; grid-template-columns: 2fr 3fr; gap: 16px 12px; }
.oidc-screen .field-grid > .field { grid-column: 1 / -1; }
.oidc-screen .field-grid > .field--zip { grid-column: 1; }
.oidc-screen .field-grid > .field--city { grid-column: 2; }

.oidc-screen .hint { font-size: 14px; color: var(--muted); line-height: 1.5; margin: 0; }
.oidc-screen .err {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--danger);
    line-height: 1.45;
    margin: 0;
}
.oidc-screen .err::before {
    content: "!";
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--danger);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
/* Page-level error: a box, not a line, so it is not mistaken for a hint. */
.oidc-screen .err--box { background: var(--danger-soft); border-radius: var(--radius-card); padding: 12px 14px; }

/* ---- Choices (radio / checkbox rows as tappable tiles) ------------------ */

.oidc-screen .choice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: #ffffff;
    cursor: pointer;
    line-height: 1.4;
    transition: border-color .15s, background-color .15s;
}
.oidc-screen .choice + .choice { margin-top: 8px; }
.oidc-screen .choice:hover { border-color: var(--line-strong); }
.oidc-screen .choice:has(input:checked) { border-color: var(--navy); background: #f2f6fb; box-shadow: inset 0 0 0 1px var(--navy); }
.oidc-screen .choice:has(input:focus-visible) { outline: 3px solid var(--navy); outline-offset: 2px; }
.oidc-screen .choice input { flex-shrink: 0; margin: 1px 0 0; width: 20px; height: 20px; accent-color: var(--navy); }
.oidc-screen .choice strong { display: block; font-weight: 600; }
.oidc-screen .choice small { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }

/* Defect tiles: a checked tile means "something is wrong", so it turns warm,
   not navy. */
.oidc-screen .choice--defect:has(input:checked) { border-color: var(--danger); background: var(--danger-soft); box-shadow: inset 0 0 0 1px var(--danger); }
.oidc-screen .choice--defect input { accent-color: var(--danger); }

/* A bare checkbox row (terms) keeps the old, borderless look. */
.oidc-screen .choice--plain { border: 0; padding: 0; background: none; }
.oidc-screen .choice--plain:has(input:checked) { background: none; box-shadow: none; }

/* ---- Buttons ----------------------------------------------------------- */

.oidc-screen .cta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 14px 24px;
    background: var(--navy);
    color: #ffffff;
    border: 1px solid var(--navy);
    border-radius: var(--radius);
    font-family: var(--font);
    font-weight: 600;
    font-size: 18px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s;
}
.oidc-screen .cta:hover { background: var(--navy-600); }
.oidc-screen .cta:disabled, .oidc-screen .cta--disabled { opacity: .5; cursor: not-allowed; }
.oidc-screen .cta--ghost { background: #ffffff; color: var(--navy); border-color: var(--line-strong); font-size: 17px; }
.oidc-screen .cta--ghost:hover { background: var(--surface); }
.oidc-screen .cta--ghost:disabled:hover { background: #ffffff; }
.oidc-screen .cta--bankid::before {
    content: "";
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--mint);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4 5v6c0 5 3.4 9.7 8 11 4.6-1.3 8-6 8-11V5l-8-3z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4 5v6c0 5 3.4 9.7 8 11 4.6-1.3 8-6 8-11V5l-8-3z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---- Small pieces ------------------------------------------------------ */

.oidc-screen .trust-row { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.oidc-screen .trust-row span { display: inline-flex; align-items: center; gap: 8px; }
.oidc-screen .trust-row svg { color: var(--mint-ink); flex-shrink: 0; }

.oidc-screen .foot {
    margin-top: auto;
    padding-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--muted);
    text-align: center;
}

.oidc-screen .kv { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.oidc-screen .kv:first-child { padding-top: 0; }
.oidc-screen .kv:last-child { border-bottom: 0; padding-bottom: 0; }
.oidc-screen .kv dt { font-size: 14px; color: var(--muted); }
.oidc-screen .kv dd { margin: 0; font-size: 16px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.oidc-screen .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    background: var(--mint-soft);
    color: var(--mint-ink);
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 0;
}

.oidc-screen .notice {
    display: flex;
    gap: 12px;
    background: var(--warn-soft);
    border-left: 4px solid var(--warn);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 14px;
    color: var(--warn-ink);
    line-height: 1.5;
    margin-bottom: 0;
}
.oidc-screen .notice strong { color: #3d2c00; }

.oidc-screen .tile { width: 64px; height: 64px; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0; }
.oidc-screen .tile--ok { background: var(--mint); color: var(--navy); }
.oidc-screen .tile--muted { background: #ffffff; border: 1px solid var(--line); color: var(--muted); }
.oidc-screen .tile + .page-title { margin-top: 20px; }

/* The dev stub, deliberately unlovely so it cannot be mistaken for a
   customer-facing screen. */
.oidc-screen .stub { border: 2px dashed var(--line-strong); border-radius: 16px; background: #ffffff; padding: 24px; }
.oidc-screen .stub-tag { display: inline-block; background: #eeeeea; color: var(--muted); font-size: 12px; padding: 4px 10px; border-radius: 999px; }

/* ---- Trade-in: step indicator ------------------------------------------ */

.oidc-screen .stepper { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 24px; padding: 0; }
.oidc-screen .stepper li { font-size: 13px; color: var(--muted); }
.oidc-screen .stepper li::before { content: ""; display: block; height: 4px; border-radius: 2px; background: var(--line); margin-bottom: 6px; }
.oidc-screen .stepper .is-done::before { background: var(--navy); }
.oidc-screen .stepper .is-current { color: var(--navy); font-weight: 600; }
.oidc-screen .stepper .is-current::before { background: var(--navy); }

/* ---- Trade-in: device summary ------------------------------------------ */

.oidc-screen .device {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 12px 14px;
}
.oidc-screen .device-icon { width: 40px; height: 40px; border-radius: var(--radius); background: var(--surface); color: var(--navy); display: grid; place-items: center; flex-shrink: 0; }
.oidc-screen .device-name { font-weight: 600; font-size: 17px; line-height: 1.25; color: var(--navy); }
.oidc-screen .device-meta { font-size: 14px; color: var(--muted); }
.oidc-screen .device-edit { margin-left: auto; font-size: 14px; }

/* ---- Trade-in: offer ----------------------------------------------------
   The one loud element of the flow: a navy price tag with the amount in mint. */

.oidc-screen .offer {
    position: relative;
    background: var(--navy);
    color: #ffffff;
    border-radius: var(--radius-card);
    padding: 22px 20px 18px;
    overflow: hidden;
}
.oidc-screen .offer .page-title { color: #ffffff; font-size: 18px; font-weight: 500; margin: 0; }
.oidc-screen .price {
    margin: 2px 0 0;
    font-size: clamp(52px, 16vw, 68px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--mint);
    font-variant-numeric: tabular-nums;
}
.oidc-screen .price small { font-size: .45em; font-weight: 600; letter-spacing: 0; margin-left: 4px; }
.oidc-screen .offer-for { margin: 10px 0 0; font-size: 16px; color: #dfe6ef; }
.oidc-screen .offer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0;
    padding: 14px 0 0;
    border-top: 1px dashed rgba(255, 255, 255, .28);
    font-size: 14px;
    color: #dfe6ef;
}
.oidc-screen .offer-meta span { display: inline-flex; align-items: center; gap: 6px; }
.oidc-screen .offer-meta .grade { background: rgba(159, 238, 172, .16); color: var(--mint); font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.oidc-screen .offer-meta .expiry { margin-left: auto; }
.oidc-screen .offer-note { font-size: 14px; color: var(--muted); margin: 10px 2px 0; }

/* ---- Utilities ---------------------------------------------------------- */

.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .ml-2 { margin-left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 640px) {
    .oidc-main { padding-top: 40px; }
    .oidc-screen .page-title { font-size: 32px; }
    .oidc-screen .oidc-card { padding: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
