/*
 * Site-wide tokens and base (048/T044). Design values from the approved canvas (design/sitio-cliente/lib.py).
 * The cut-off and the touch sizes are design, not behavior: NOT configurable (DECR-792 R6), so they are not in Settings.
 */
:root {
    /* breakpoint: documentation only, media queries cannot read variables; the layout CSS repeats it once. */
    --bp-desktop: 900px;
    --bp-short: 500px;  /* the desktop navigation also needs this much height (DECR-792 R19) */
    --bp-column: 600px; /* from here the content is one centred column and card lists have two (R20) */

    /* touch and bars (FR-052; the tab bar equals the app, client_shell.dart height 68) */
    --touch-min: 48px;
    --topbar-h: 64px;
    --topbar-h-mobile: 56px;
    --tabbar-h: 68px;
    --profile-w: 300px;
    --rail-w: 64px;

    /* spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 40px;
    --radius-sm: 8px;
    --radius-md: 11px;

    /* canvas colors; ink2 is used for all small text (AA contrast) */
    --c-bone: #FFF8F2;
    --c-white: #FFFFFF;
    --c-line: #E8DFD5;
    --c-ink: #2B1A0E;
    --c-ink2: #6B5645;
    --c-orange: #FF7A1A;
    --c-deep: #C2410C;
    --c-soft: #F3E4D5;

    /* identity card and the VERIFICADA pill (048/T060, twin of identity_card.dart; canvas v18) */
    --c-ok: #15803D;
    --c-ok-bg: #DCFCE7;
    --c-peach: #FFE3CC;
    --c-on-peach: #9A3412;
    --c-ink3: #9C8770;
    --radius-lg: 16px;
    --avatar-size: 52px;
    --pill-radius: 7px;
    --pill-gap: 6px;
    --pill-pad-y: 3px;
    --pill-check: 11px;
}

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

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

body {
    margin: 0;
    background: var(--c-bone);
    color: var(--c-ink);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.45;
}

a {
    color: var(--c-deep);
}

img,
svg,
video {
    max-width: 100%;
}

:focus-visible {
    outline: 3px solid var(--c-deep);
    outline-offset: 2px;
}

/* Focus moved by FocusOnNavigate to a heading is not a control: no ring (048/T044-H1). */
h1[tabindex="-1"]:focus {
    outline: none;
}

/* Entry screens (048/T024): Entrar, Verificar, Activar dos pasos. One card, 420 px at most, touch targets of 48 px,
   16 px text so phones do not zoom on focus. Errors carry an icon and text, never color alone. */
.auth {
    display: flex;
    justify-content: center;
    padding: var(--space-4) var(--space-3);
}

.auth__card {
    width: 100%;
    max-width: 420px;
    padding: var(--space-4);
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-md);
}

.auth__title {
    margin: 0 0 var(--space-2);
    font-size: 1.5rem;
    line-height: 1.25;
}

.auth__subtitle,
.auth__notice {
    margin: 0 0 var(--space-3);
    color: var(--c-ink2);
}

.auth__form {
    display: block;
}

.auth__field {
    margin-bottom: var(--space-3);
}

.auth__label {
    display: block;
    margin-bottom: var(--space-1);
    font-weight: 600;
}

.auth__input {
    width: 100%;
    min-height: var(--touch-min);
    padding: 0 12px;
    font: inherit;
    font-size: 1rem;
    color: var(--c-ink);
    background: var(--c-white);
    border: 1px solid #8A7566;
    border-radius: var(--radius-sm);
}

.auth__input[aria-invalid="true"] {
    border: 2px solid #B42318;
}

.auth__input--code {
    letter-spacing: 0.2em;
    text-align: center;
}

.auth__password {
    position: relative;
}

.auth__password .auth__input {
    padding-right: 96px;
}

.auth__reveal {
    position: absolute;
    top: 0;
    right: 0;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    padding: 0 12px;
    font: inherit;
    font-weight: 600;
    color: var(--c-deep);
    background: none;
    border: 0;
    cursor: pointer;
}

.auth__reveal[hidden] {
    display: none;
}

.auth__submit {
    display: block;
    width: 100%;
    min-height: var(--touch-min);
    padding: 0 var(--space-3);
    font: inherit;
    font-weight: 600;
    color: var(--c-white);
    text-align: center;
    background: var(--c-deep);
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.auth__submit--link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.auth__submit[aria-disabled="true"] {
    opacity: 0.7;
    cursor: progress;
}

.auth__aside {
    margin: var(--space-3) 0 0;
    text-align: center;
}

.auth__aside a {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch-min);
}

.auth__secret {
    margin: 0 0 var(--space-3);
}

.auth__secret dt {
    font-weight: 600;
}

.auth__secret dd {
    margin: 0 0 var(--space-3);
    overflow-wrap: anywhere;
}

.auth-alert {
    display: flex;
    gap: var(--space-2);
    align-items: flex-start;
    margin-bottom: var(--space-3);
    padding: 12px;
    color: #7A271A;
    background: #FEF3F2;
    border: 1px solid #B42318;
    border-radius: var(--radius-sm);
}

.auth-alert--info {
    color: var(--c-ink);
    background: var(--c-soft);
    border-color: var(--c-deep);
}

.auth-alert__icon {
    flex: none;
    margin-top: 1px;
}

.auth-alert__text {
    margin: 0;
}

.site-notice {
    margin: 0;
    padding: 12px var(--space-3);
    font-weight: 600;
    background: var(--c-soft);
    border-bottom: 1px solid var(--c-line);
}

.zone-gate {
    margin: 0;
    padding: var(--space-4);
    color: var(--c-ink2);
}
