/* REdy Market — hand-written, mobile-first. No framework, no CDN.
   Base design target: 360px viewport on a 3G connection.
   The only web asset is a self-hosted latin Poppins subset below: same-origin, so it is
   already covered by `default-src 'self'` and needs no CSP change. `font-display: swap`
   keeps text readable on the system fallback while it downloads. */

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/poppins-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/poppins-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/poppins-700.woff2') format('woff2');
}

:root {
    --redy-red:      #ee3433;
    --redy-red-dark: #c02739;
    --redy-light-bg: #f8f8f8;
    --redy-text:     #1a1a1a;
    --redy-muted:    #555555;
    --redy-border:   #e5e5e5;
    --redy-font:     'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* Kept distinctly darker than the brand red so an error never reads as a brand accent.
       9.0:1 on white, and every error also carries a marker glyph or icon. */
    --error: #a3121b;
}

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

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

body {
    margin: 0;
    background: var(--redy-light-bg);
    color: var(--redy-text);
    font-family: var(--redy-font);
    font-size: 1rem;
    line-height: 1.5;
}

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

.site-header {
    padding: 1rem;
    background: #ffffff;
    border-bottom: 1px solid var(--redy-border);
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--redy-text);
    text-decoration: none;
}

.brand-mark { color: var(--redy-red); }

/* No horizontal padding here: the hero band stays edge-to-edge at every width, and the
   card supplies its own gutter (full-bleed on mobile, floating on desktop). */
.site-main {
    padding: 0 0 2rem;
}

.card {
    background: #ffffff;
    padding: 1.5rem 1rem 2rem;
}

.site-footer {
    padding: 1.25rem 1rem 2rem;
    border-top: 1px solid var(--redy-border);
    color: var(--redy-muted);
    font-size: 0.875rem;
}

.site-footer nav a {
    margin-right: 1rem;
}

.footer-note { margin: 0.75rem 0 0; }

/* ---------- hero band (landing) ---------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: 1.75rem 1rem 2rem;
    background: var(--redy-red);
    color: #ffffff;
}

/* One soft decorative circle, pure CSS — no image request. */
.hero::after {
    content: "";
    position: absolute;
    top: -70px;
    right: -60px;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.hero-inner { position: relative; }

.hero h1 {
    margin: 0;
    color: #ffffff;
}

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

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 0.5rem;
}

h2 {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 1.5rem 0 0.5rem;
}

.lede {
    margin: 0 0 1.5rem;
    color: var(--redy-muted);
}

a {
    color: var(--redy-red);
}

a:hover {
    color: var(--redy-red-dark);
}

/* Small eyebrow label above a heading. */
.step-indicator {
    margin: 0 0 0.5rem;
    color: var(--redy-red);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 2.5px;
}

/* ---------- form ---------- */

.field {
    margin-bottom: 1.25rem;
}

.field label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 600;
}

.optional {
    font-weight: 400;
    color: var(--redy-muted);
}

.hint {
    display: block;
    margin-top: 0.375rem;
    color: var(--redy-muted);
    font-size: 0.875rem;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
select {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    border: 1.5px solid var(--redy-border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--redy-text);
    font-family: inherit;
    font-size: 1rem;
}

select {
    /* keep the native control; just make room for the platform chevron */
    padding-right: 2rem;
}

input[type="checkbox"] { accent-color: var(--redy-red); }

/* Red focus: recoloured border plus a ring. The transparent outline is a no-op visually
   but keeps a focus indicator in Windows High Contrast / forced-colors mode. */
input:focus-visible,
select:focus-visible {
    border-color: var(--redy-red);
    box-shadow: 0 0 0 3px rgba(238, 52, 51, 0.25);
    outline: 2px solid transparent;
    outline-offset: 0;
}

button:focus-visible,
a:focus-visible,
input[type="checkbox"]:focus-visible {
    outline: 3px solid var(--redy-red);
    outline-offset: 2px;
}

/* consent row: checkbox stays a comfortable tap target next to its label */
.field-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.field-consent input[type="checkbox"] {
    width: 24px;
    height: 24px;
    margin: 0.5rem 0 0;
    flex: 0 0 auto;
}

.field-consent label {
    margin: 0;
    font-weight: 400;
}

/* ---------- buttons ---------- */

button[type="submit"],
.button-link {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 14px 32px;
    border: 0;
    border-radius: 50px;
    background: var(--redy-red);
    color: #ffffff;
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(238, 52, 51, 0.25);
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.button-link { margin-top: 1.5rem; }

button[type="submit"]:hover,
.button-link:hover {
    background: var(--redy-red-dark);
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(238, 52, 51, 0.32);
    transform: translateY(-2px);
}

/* Secondary action: same pill, same 44px target, no fill. */
.skip-link {
    display: block;
    margin-top: 0.875rem;
    padding: 12px 24px;
    min-height: 44px;
    border: 1.5px solid transparent;
    border-radius: 50px;
    color: var(--redy-red);
    font-weight: 600;
    font-size: 1rem;
    line-height: 20px;
    text-align: center;
    text-decoration: none;
}

.skip-link:hover {
    border-color: var(--redy-border);
    color: var(--redy-red-dark);
}

@media (prefers-reduced-motion: reduce) {
    button[type="submit"],
    .button-link {
        transition: none;
    }

    button[type="submit"]:hover,
    .button-link:hover {
        transform: none;
    }
}

/* ---------- validation ----------
   The validation tag helpers emit a -valid or -error class on every placeholder,
   so the valid state must be hidden or empty markers would show on clean fields. */

.field-validation-valid,
.validation-summary-valid {
    display: none;
}

.field-validation-error,
.validation-summary-errors {
    color: var(--error);
    font-size: 0.9375rem;
}

.field-validation-error {
    display: block;
    margin-top: 0.375rem;
}

/* A leading marker so the error does not rely on colour alone. */
.field-validation-error::before {
    content: "\26A0\FE0E";
    margin-right: 0.375rem;
}

.validation-summary-errors {
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--error);
    border-left-width: 4px;
    border-radius: 10px;
    background: #fdf3f4;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

.input-validation-error {
    border-color: var(--error);
}

/* Razor's default error view still ships these Bootstrap class names. */
.text-danger { color: var(--error); }

/* ---------- success page ---------- */

.success-panel {
    text-align: center;
}

.progress-row {
    display: flex;
    justify-content: space-between;
    margin: 1.5rem 0 0.5rem;
    font-weight: 600;
}

.progress-track {
    height: 10px;
    border-radius: 5px;
    background: var(--redy-border);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 5px;
    background: var(--redy-red);
}

/* ---------- profile ---------- */

.screen-list {
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--redy-border);
}

.screen-list li {
    border-bottom: 1px solid var(--redy-border);
}

.screen-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 56px;
    padding: 0.75rem 0;
    color: var(--redy-text);
    text-decoration: none;
}

.screen-list a:hover .screen-state { color: var(--redy-red-dark); }

.screen-name { font-weight: 600; }

.screen-state {
    color: var(--redy-red);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

.checkbox-group {
    margin: 0 0 1.5rem;
    padding: 0;
    border: 0;
}

.checkbox-group legend {
    padding: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
}

.checkbox-row input[type="checkbox"] {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}

/* ---------- desktop ---------- */

@media (min-width: 768px) {
    .site-header > .brand,
    .hero-inner,
    .site-footer > * {
        display: block;
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero {
        padding: 2.5rem 1rem 3rem;
    }

    .hero h1 {
        font-size: 1.875rem;
    }

    .site-main {
        padding-bottom: 3.5rem;
    }

    .card {
        max-width: 560px;
        margin: 2.5rem auto 0;
        padding: 2.5rem;
        border-radius: 20px;
        box-shadow: 0 4px 40px rgba(0, 0, 0, 0.07);
    }
}
