/*
 * Pioneer RC1 × Ace Hardware — shared design system
 * Used by the public promo page, admin, login and draw screens.
 */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,600;0,700;1,700;1,800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Brand */
    --red: #E2001A;
    --red-600: #C80017;
    --red-700: #A30013;
    --red-50: #FFF1F2;
    --red-100: #FFE0E3;
    --yellow: #FFC20E;
    --ink: #0E0E0E;
    --ink-2: #1C1C1C;
    --ink-3: #2A2A2A;

    /* Neutrals */
    --text: #1F2937;
    --muted: #6B7280;
    --line: #E5E7EB;
    --line-strong: #D1D5DB;
    --bg: #F5F5F6;
    --surface: #FFFFFF;

    /* Status */
    --green: #15803D;
    --green-50: #ECFDF3;
    --amber: #B45309;
    --amber-50: #FFF7E6;
    --danger: #B91C1C;
    --danger-50: #FEF2F2;
    --blue: #1D4ED8;
    --blue-50: #EFF6FF;

    --font-display: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow: 0 4px 16px rgba(16, 24, 40, .08);
    --shadow-lg: 0 20px 48px rgba(16, 24, 40, .18);
    --focus: 0 0 0 3px rgba(226, 0, 26, .28);
}

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

[hidden] { display: none !important; }

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

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--red); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
code { font-size: .9em; background: var(--bg); padding: .1em .35em; border-radius: 4px; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.display {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .01em;
}

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }

/* ---------- Brand mark ---------- */
.brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    color: #fff;
}

.brand-logo {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 800;
    font-size: 1.6rem;
    line-height: 1;
    padding: .3rem .85rem .35rem;
    border-radius: 4px;
    transform: skewX(-8deg);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .15);
}

.brand-logo > span { display: inline-block; transform: skewX(8deg); }

.brand-partner {
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .9;
}

/* ---------- Buttons ---------- */
.btn {
    --btn-bg: var(--surface);
    --btn-fg: var(--ink);
    --btn-border: var(--line-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 44px;
    padding: .65rem 1.15rem;
    border: 1px solid var(--btn-border);
    border-radius: var(--radius-sm);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font: 600 .95rem/1.2 var(--font-body);
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}

.btn:hover:not(:disabled) { filter: brightness(.96); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { --btn-bg: var(--red); --btn-fg: #fff; --btn-border: var(--red); }
.btn-primary:hover:not(:disabled) { --btn-bg: var(--red-600); filter: none; }
.btn-dark { --btn-bg: var(--ink); --btn-fg: #fff; --btn-border: var(--ink); }
.btn-success { --btn-bg: var(--green); --btn-fg: #fff; --btn-border: var(--green); }
.btn-warning { --btn-bg: var(--amber); --btn-fg: #fff; --btn-border: var(--amber); }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-border: var(--danger); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; }
.btn-light { --btn-bg: rgba(255, 255, 255, .1); --btn-fg: #fff; --btn-border: rgba(255, 255, 255, .25); }
.btn-lg { min-height: 52px; padding: .85rem 1.6rem; font-size: 1.05rem; }
.btn-sm { min-height: 34px; padding: .35rem .75rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-cta {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: .03em;
    text-transform: uppercase;
}

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field + .field { margin-top: 1rem; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.field-row + .field, .field + .field-row, .field-row + .field-row { margin-top: 1rem; }
.field-row > .field { margin-top: 0; }

.label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.label .req { color: var(--red); }
.hint { font-size: .825rem; color: var(--muted); }

.input, .select, .textarea {
    width: 100%;
    min-height: 46px;
    padding: .65rem .85rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: 400 1rem/1.4 var(--font-body);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--red); box-shadow: var(--focus); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-error { font-size: .825rem; color: var(--danger); font-weight: 500; }
.field-error:empty { display: none; }

.checkbox { display: flex; gap: .65rem; align-items: flex-start; font-size: .9rem; }
.checkbox input { width: 20px; height: 20px; margin-top: .1rem; accent-color: var(--red); flex: none; }

/* Quantity stepper */
.stepper { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.stepper:focus-within { border-color: var(--red); box-shadow: var(--focus); }
.stepper button { width: 46px; border: 0; background: var(--bg); font-size: 1.25rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.stepper button:hover { background: var(--line); }
.stepper input { flex: 1; min-width: 0; border: 0; text-align: center; font: 700 1.1rem var(--font-body); padding: .5rem; -moz-appearance: textfield; }
.stepper input:focus { outline: none; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Cards & surfaces ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-pad { padding: 1.25rem; }
.card-title { font-size: 1rem; font-weight: 700; margin: 0 0 .75rem; color: var(--ink); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
    background: var(--bg);
    color: var(--muted);
}

.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending { background: var(--blue-50); color: var(--blue); }
.badge-approved, .badge-pass { background: var(--green-50); color: var(--green); }
.badge-resubmit, .badge-review { background: var(--amber-50); color: var(--amber); }
.badge-rejected, .badge-fail { background: var(--danger-50); color: var(--danger); }
.badge-none, .badge-error, .badge-skipped { background: var(--bg); color: var(--muted); }

/* ---------- Alerts ---------- */
.alert {
    display: flex;
    gap: .75rem;
    padding: .9rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--bg);
    font-size: .925rem;
}

.alert strong { color: var(--ink); }
.alert-info { background: var(--blue-50); border-color: #BFDBFE; }
.alert-success { background: var(--green-50); border-color: #BBF7D0; }
.alert-warning { background: var(--amber-50); border-color: #FDE68A; }
.alert-danger { background: var(--danger-50); border-color: #FECACA; }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }

/* ---------- Dialogs ---------- */
dialog {
    border: 0;
    padding: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: min(560px, calc(100vw - 2rem));
    width: 100%;
    color: var(--text);
}

dialog::backdrop { background: rgba(14, 14, 14, .6); backdrop-filter: blur(2px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 1.15rem; }
.dialog-body { padding: 1.25rem; }
.dialog-foot { display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; padding: 1rem 1.25rem; border-top: 1px solid var(--line); background: #FAFAFA; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--bg); color: var(--ink); }

/* Summary lists */
.summary { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0; font-size: .925rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; color: var(--ink); word-break: break-word; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; z-index: 2000; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.toast { padding: .85rem 1rem; border-radius: var(--radius-sm); background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: .925rem; animation: toast-in .2s ease; }
.toast-success { background: var(--green); }
.toast-error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Spinner ---------- */
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
