/*
 * Axan web app. Every value comes from tokens.css.
 * Flat color only: no gradients, no shadows. Underlines are for links only.
 */

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font: var(--copy-body);
}

h1,
h2,
p,
ul,
dl,
dd {
    margin: 0;
    padding: 0;
}

/* --- Page frame ------------------------------------------------------------ */

.frame {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.frame__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--page-margin) var(--page-margin) 0;
}

.frame__account {
    font: var(--copy-caption);
    color: var(--muted);
    text-align: right;
    overflow-wrap: anywhere;
}

.frame__main {
    display: grid;
    place-items: center;
    padding: var(--space-4) var(--page-margin);
}

.frame__footer {
    padding: 0 var(--page-margin) var(--page-margin);
    font: var(--copy-caption);
    color: var(--muted);
}

.column {
    width: 100%;
    max-width: var(--column-form);
    display: grid;
    gap: var(--space-3);
}

.column--wide {
    max-width: var(--column-wide);
}

/* --- Logo -------------------------------------------------------------------- */

.logo {
    display: block;
    width: var(--logo-width);
    height: auto;
}

/* --- Type -------------------------------------------------------------------- */

.page-heading {
    font: var(--heading-page);
    overflow-wrap: anywhere;
}

/* One brand rule per screen, under the page heading. */
.page-heading::after {
    content: "";
    display: block;
    width: var(--brand-rule-width);
    height: var(--brand-rule-height);
    margin-top: var(--space-2);
    background: var(--axan-blue);
}

.section-heading {
    font: var(--heading-section);
}

.muted {
    color: var(--muted);
}

.strong {
    color: var(--ink);
    font-weight: 500;
    overflow-wrap: anywhere;
}

.caption {
    font: var(--copy-caption);
    color: var(--muted);
}

a,
.link {
    color: var(--axan-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* A form button that reads as a link. */
.link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    font: var(--copy-caption);
    cursor: pointer;
}

a.link {
    font: var(--copy-caption);
}

/* --- Forms ------------------------------------------------------------------- */

.form {
    display: grid;
    gap: var(--space-3);
}

.field {
    display: grid;
    gap: var(--space-1);
}

.label {
    font: var(--copy-label);
    color: var(--ink);
}

.input {
    width: 100%;
    height: var(--control-height);
    padding: 0 var(--space-2);
    border: 1px solid var(--input-border);
    border-radius: var(--corner-control);
    background: var(--ground);
    color: var(--ink);
    font: var(--copy-body);
}

.input::placeholder {
    color: var(--muted);
    opacity: 1;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--control-height);
    padding: 0 var(--space-2);
    border: 1px solid var(--axan-blue);
    border-radius: var(--corner-control);
    background: var(--axan-blue);
    color: var(--on-blue);
    font: var(--copy-body);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.button--plain {
    border-color: var(--ink);
    background: var(--ground);
    color: var(--ink);
}

.button-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--space-3);
}

.link-row form {
    display: contents;
}

/* Focus: always visible, always axan-blue. */
.input:focus-visible,
.code__box:focus-visible {
    outline: 2px solid var(--axan-blue);
    outline-offset: -2px;
    border-color: var(--axan-blue);
}

.button:focus-visible,
a:focus-visible,
.link:focus-visible {
    outline: 2px solid var(--axan-blue);
    outline-offset: 2px;
}

/* --- Six-digit code ---------------------------------------------------------- */

.code {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
    display: grid;
    gap: var(--space-1);
}

.code__boxes {
    display: flex;
    gap: var(--space-1);
}

.code legend {
    padding: 0;
}

/* 56px wide, and narrower only when the screen cannot fit six of them. */
.code__box {
    flex: 0 1 56px;
    width: 56px;
    min-width: 0;
    height: 64px;
    padding: 0;
    border: 1px solid var(--input-border);
    border-radius: var(--corner-control);
    background: var(--ground);
    color: var(--ink);
    font: 400 28px/1 var(--font-heading);
    text-align: center;
}

/* On the narrowest phones the boxes share the width and stay 44px or wider. */
@media (max-width: 400px) {
    .code__boxes {
        gap: 4px;
    }
}

/* --- Panels ------------------------------------------------------------------ */

/* A message to the person: a problem with what they entered, or a confirmation. */
.callout {
    padding: var(--space-2);
    background: var(--tint);
    color: var(--ink);
}

.summary {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-2);
    background: var(--surface);
}

.summary__row {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: var(--space-2);
}

.summary__name {
    font: var(--copy-label);
    line-height: 26px;
    color: var(--muted);
}

.summary__value {
    overflow-wrap: anywhere;
}

.section {
    display: grid;
    gap: var(--space-1);
}

.list {
    padding-left: 20px;
}

.list li {
    padding-left: 4px;
}

.hairline {
    height: 1px;
    border: 0;
    margin: 0;
    background: var(--rule);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
