/* ------------------------------------------------------------------------- *
   SmartEMV - global stylesheet.

   Palette: black and white as the main colours, with #d3a243 (gold) and
   #e7dc8e (sand) used sparingly as accents. Minimal, content-centred layout.

   Everything here is class-based on purpose: the backend (website.py) and the
   .function JS files address elements by id (email, password, cap-img,
   cap-input, submit, missing-fields, inactive, unsubscribed, active, ...), so
   no rule below depends on an id and nothing here can break that contract.
   Error divs keep their inline display:none - the JS flips it to "block", so
   .msg must never set a display of its own.
 * ------------------------------------------------------------------------- */

:root {
    --ink: #000000;
    --paper: #ffffff;
    --gold: #d3a243;
    --sand: #e7dc8e;

    --muted: #6b6b6b;
    --line: #e2e2e2;
    --rule: #000000;
    --tint: #fbf7e9;          /* barely-there wash of --sand */

    --col: 670px;             /* the single centred content column */
    --read: 480px;            /* narrower measure for running text */
    --header-width: var(--col);

    /* Modern grotesk first, system UI faces after. No serif or typewriter
       faces anywhere: they are the ones that read as dated. */
    --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui,
            -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue",
            Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", "Segoe UI Mono", "Roboto Mono",
            "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
    background: var(--paper);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0 20px 64px;
    background: var(--paper);
    color: var(--ink);
    font: 15px/1.75 var(--sans);
    font-feature-settings: "kern" 1;
    text-rendering: optimizeLegibility;
}

::selection { background: var(--sand); color: var(--ink); }

/* --- top domain banner (full bleed, outside .page) ------------------------ */

.domain-banner {
    display: none;
    width: calc(100% + 40px);
    margin: 0 -20px 0;
    padding: 9px 20px;
    background: var(--ink);
    color: var(--paper);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 1.5px;
    text-align: center;
    text-transform: uppercase;
}

.domain-banner a {
    color: var(--paper);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.domain-banner a:hover, .domain-banner a:focus {
    color: var(--sand);
}

/* --- shell ---------------------------------------------------------------- */

.page {
    width: 100%;
    max-width: var(--col);
    margin: 0 auto;
}

.masthead,
.nav {
    width: var(--header-width);
    max-width: var(--header-width);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.masthead {
    padding: 46px 0 24px;
    display: flex;
    justify-content: center;
    text-align: left;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: none;
}

.logo:hover, .logo:focus { background: none; color: inherit; }

/* the source image is 998x998; hard-cap it so it can never render at full size */
.logo .mark {
    width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
    flex-shrink: 0;
}

.masthead-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.wordmark {
    display: block;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 6px;
    margin-right: -6px;
}

.tagline {
    display: inline-block;
    margin: 4px 0 0;
    padding-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3.5px;
    border-bottom: 1px solid var(--gold);
}

/* --- navigation ----------------------------------------------------------- */

.nav {
    padding: 0 0 14px;
    border-bottom: 1px solid var(--ink);
    text-align: center;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
}

.nav a {
    display: inline-block;
    padding: 4px 2px;
    margin: 0 6px;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.nav a:hover, .nav a:focus {
    background: none;
    color: var(--ink);
    border-bottom-color: var(--gold);
}

.nav a.here {
    border-bottom-color: var(--ink);
}

/* sits apart from the destinations: it is an action, not a page */
.nav a.logout { color: var(--muted); }
.nav a.logout:hover, .nav a.logout:focus { color: var(--ink); }

/* --- typography ----------------------------------------------------------- */

a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--gold);
}

a:visited { color: var(--ink); }
a:hover, a:focus { background: var(--sand); }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

h1 {
    margin: 0 0 14px;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.32;
    letter-spacing: -0.4px;
}

h2 {
    margin: 0 0 18px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* short gold rule under every section heading */
h2::after {
    content: "";
    display: block;
    width: 26px;
    height: 2px;
    margin: 10px auto 0;
    background: var(--gold);
}

h3 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

p { margin: 0 0 16px; }

.lead {
    margin: 0 auto 22px;
    max-width: var(--read);
    color: #333333;
    font-size: 15.5px;
    line-height: 1.72;
}

.page.home { max-width: 720px; }

.hero-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
}

.hero-split-release {
    text-align: center;
}

.hero-split-release .hero-product {
    margin-bottom: 0;
}

.hero-split-copy {
    text-align: left;
}

.hero-split-copy h1 {
    text-align: left;
}

.hero-split-copy .lead {
    margin-left: 0;
    margin-right: 0;
}

.hero-split-copy .download {
    text-align: left;
}

.bench-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 46px;
}

.bench-split-bench h2,
.bench-split-atm h2 {
    text-align: center;
}

.bench-split-bench .prose {
    max-width: var(--read);
    margin: 0 auto;
}

.bench-split-atm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.bench-split-atm h2 {
    grid-column: 1 / -1;
}

.bench-split-atm .atm-lead {
    grid-column: 1 / -1;
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.atm-photo {
    margin: 0;
}

.atm-photo img {
    display: block;
    width: 100%;
    height: auto;
}

.hero-product {
    margin: 0 auto 22px;
    max-width: 320px;
}

.hero-product img {
    display: block;
    width: 100%;
    height: auto;
}

.note {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.7;
}

.center { text-align: center; }
.mono { font-family: var(--mono); }

strong { font-weight: 600; }

mark {
    background: var(--sand);
    color: var(--ink);
    padding: 0 3px;
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 40px 0;
}

/* --- layout --------------------------------------------------------------- */

.content { padding: 40px 0 0; }

.section { margin: 0 0 46px; }
.section:last-child { margin-bottom: 0; }

.section > h2 { text-align: center; }

.prose { max-width: var(--read); margin: 0 auto; text-align: left; }

.panel { max-width: 340px; margin: 0 auto; }

.page.dashboard .panel { max-width: 520px; }

.page.dashboard .activation-option { padding: 22px 20px; }

/* --- lists ---------------------------------------------------------------- */

ul.dashed { list-style: none; margin: 0 0 16px; padding: 0; }
ul.dashed li { position: relative; padding-left: 18px; }
ul.dashed li + li { margin-top: 7px; }
ul.dashed li::before {
    content: "\2014";
    position: absolute;
    left: 0;
    color: var(--gold);
}

ul.dashed ul.dashed {
    margin: 8px 0 0;
}

.rec-details {
    margin-top: 10px;
}

.rec-summary {
    cursor: pointer;
    font-size: 12.5px;
    color: var(--muted);
    list-style: none;
    user-select: none;
}

.rec-summary::-webkit-details-marker {
    display: none;
}

.rec-summary::marker {
    content: "";
}

.rec-summary::before {
    content: "+ ";
    color: var(--gold);
    font-weight: 700;
}

.rec-details[open] > .rec-summary::before {
    content: "− ";
}

.rec-details .box {
    margin-top: 10px;
    margin-bottom: 0;
}

/* numbered steps */
ol.steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    max-width: var(--read);
    margin: 0 auto;
    text-align: left;
}

ol.steps > li {
    counter-increment: step;
    position: relative;
    padding: 0 0 24px 54px;
    border-left: 1px solid var(--line);
    margin-left: 15px;
}

ol.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }

ol.steps > li::before {
    content: counter(step, decimal-leading-zero);
    position: absolute;
    left: -15px;
    top: 0;
    width: 30px;
    height: 30px;
    border: 1px solid var(--ink);
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
    line-height: 28px;
    text-align: center;
}

ol.steps > li p:last-child { margin-bottom: 0; }

/* --- feature grid --------------------------------------------------------- */

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}

.cell {
    background: var(--paper);
    padding: 20px 15px;
    text-align: center;
}

.cell .glyph {
    display: block;
    margin-bottom: 10px;
    color: var(--gold);
    font-size: 19px;
    line-height: 1;
}

.cell h3 { font-size: 12.5px; }
.cell p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

/* --- bordered box with a caption bar -------------------------------------- */

.box { border: 1px solid var(--ink); margin: 0 0 20px; }

.box-title {
    background: var(--ink);
    color: var(--paper);
    padding: 8px 14px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
}

.box-body { padding: 16px; font-size: 13.5px; line-height: 1.7; }
.box-body p:last-child { margin-bottom: 0; }
.box-body ul.dashed { margin-bottom: 0; }

.notice {
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    background: var(--tint);
    padding: 16px 18px;
    margin: 0 0 20px;
    font-size: 13.5px;
    line-height: 1.7;
    text-align: left;
}

.notice p:last-child { margin-bottom: 0; }

/* --- tables --------------------------------------------------------------- */

table.grid {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 20px;
    font-size: 12.5px;
    text-align: left;
}

table.grid th, table.grid td {
    border-bottom: 1px solid var(--line);
    padding: 10px 10px 10px 0;
    vertical-align: top;
}

table.grid th:last-child, table.grid td:last-child { padding-right: 0; }

table.grid thead th {
    border-bottom: 1px solid var(--ink);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
}

table.grid tbody th {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

table.grid tbody tr:last-child th,
table.grid tbody tr:last-child td { border-bottom: 0; }

table.grid td.mono { font-size: 12.5px; word-break: break-all; }

/* --- forms ---------------------------------------------------------------- */

form { margin: 0; }

.field { margin-bottom: 16px; text-align: left; }

.field label, .label {
    display: block;
    margin-bottom: 7px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    display: block;
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--paper);
    color: var(--ink);
    font: 14px/1.5 var(--sans);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    background: var(--tint);
    box-shadow: inset 0 0 0 2px var(--gold);
}

::placeholder { color: #a5a5a5; opacity: 1; }

input[type="radio"] { accent-color: var(--gold); }

button {
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--ink);
    color: var(--paper);
    padding: 12px 26px;
    font: 700 11px/1.4 var(--sans);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

button:hover, button:focus {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--ink);
}

button.wide { display: block; width: 100%; }

/* secondary / icon button */
button.tiny {
    background: var(--paper);
    color: var(--ink);
    padding: 9px 13px;
    font: 400 15px/1 var(--sans);
    letter-spacing: 0;
}

button.tiny:hover, button.tiny:focus {
    background: var(--sand);
    border-color: var(--ink);
}

/* --- big download call to action ------------------------------------------ */

.download { margin: 0 0 10px; text-align: center; }

a.btn-xl {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 24px 26px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}

a.btn-xl:hover, a.btn-xl:focus {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--ink);
}

a.btn-xl .arrow {
    display: block;
    margin-bottom: 10px;
    font-size: 22px;
    line-height: 1;
    letter-spacing: 0;
    color: var(--sand);
    text-align: center;
}

a.btn-xl:hover .arrow, a.btn-xl:focus .arrow { color: var(--ink); }

a.btn-xl .sub {
    display: block;
    margin-top: 10px;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 2px;
    color: #b0b0b0;
}

a.btn-xl:hover .sub, a.btn-xl:focus .sub { color: rgba(0, 0, 0, 0.6); }

a.btn-sm {
    display: inline-block;
    margin-left: 8px;
    padding: 6px 12px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
    vertical-align: middle;
    transition: background .15s, color .15s, border-color .15s;
}

a.btn-sm:hover, a.btn-sm:focus {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--ink);
}

/* --- captcha -------------------------------------------------------------- */

.captcha {
    border: 1px solid var(--line);
    background: var(--tint);
    padding: 14px;
    margin-bottom: 18px;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.captcha img {
    display: block;
    width: 100%;
    max-width: 214px;
    height: auto;
    border: 1px solid var(--ink);
    background: var(--paper);
}

.captcha .field { margin-bottom: 0; }

/* --- messages (display is owned by the JS, never by CSS) ------------------ */

.msg {
    background: var(--ink);
    color: var(--paper);
    padding: 11px 14px;
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.6;
    text-align: left;
}

.msg::before {
    content: "!";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 9px;
    background: var(--gold);
    color: var(--ink);
    font-weight: 700;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
    vertical-align: 1px;
}

/* --- auth footers (small links under a form) ------------------------------ */

.alt {
    margin: 22px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
}

.alt a { color: var(--ink); }

/* --- dashboard ------------------------------------------------------------ */

.meta {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
    margin: 0 0 34px;
    font-size: 13px;
}

.meta div + div { margin-top: 6px; }

.meta .k {
    display: inline-block;
    min-width: 92px;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.meta .v { font-family: var(--mono); font-size: 12.5px; }

.state { text-align: center; }

.activation-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 22px 0;
    text-align: left;
}

.activation-option {
    border: 1px solid var(--line);
    padding: 18px 16px;
    background: var(--tint);
}

.activation-option h3 {
    margin: 0 0 10px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.activation-option .actions { margin-top: 14px; }

.activation-option .msg { margin-top: 12px; }

.tiers { margin: 0 0 22px; text-align: left; }

.tier {
    display: block;
    border: 1px solid var(--line);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.tier:hover { border-color: var(--ink); }

.tier:has(input:checked) {
    border-color: var(--gold);
    background: var(--tint);
}

.tier input { margin: 0 10px 0 0; vertical-align: middle; }

.tier .name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    vertical-align: middle;
}

.tier .desc {
    display: block;
    margin: 6px 0 0 26px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.65;
}

.actions { margin-top: 22px; }

.badge {
    display: inline-block;
    border: 1px solid var(--gold);
    background: var(--tint);
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
}

/* --- footer --------------------------------------------------------------- */

.foot {
    margin-top: 64px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--muted);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.foot a { color: var(--muted); border-bottom-color: var(--line); }
.foot a:hover, .foot a:focus { color: var(--ink); background: var(--sand); }
.foot .sep { margin: 0 8px; color: var(--line); }

/* --- small screens -------------------------------------------------------- */

@media (max-width: 620px) {
    body { padding: 0 16px 48px; }
    .masthead { padding: 36px 0 22px; }
    .wordmark { font-size: 17px; letter-spacing: 5px; margin-right: -5px; }
    .nav a { margin: 0 7px; }
    h1 { font-size: 24px; }
    .lead { font-size: 15.5px; }
    .hero-split {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    .hero-split-copy .download { text-align: center; }
    .hero-split-copy h1 { text-align: center; }
    .hero-split-copy { text-align: center; }
    .hero-split-copy .lead { margin-left: auto; margin-right: auto; }
    .bench-split-atm { grid-template-columns: 1fr; max-width: 320px; }
    .grid-3 { grid-template-columns: 1fr; }
    .captcha-row { flex-wrap: wrap; }
    ol.steps > li { padding-left: 44px; }
}

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