/* ==========================================================================
   KerfHand — marketing design system
   Register: equipment catalog, not farmhouse. One family (Archivo), a
   hi-vis accent used sparingly, work-order rules and tick boxes, 3–4px radii.
   ========================================================================== */

:root {
    --ink:       #161C15;   /* text, dark bands */
    --paper:     #EDEEE8;   /* page background */
    --card:      #FBFBF7;   /* raised paper (ticket, shop section) */
    --green:     #263D29;   /* hero, pricing panel, close */
    --green-hi:  #2F4A2C;   /* hover on green */
    --hivis:     #C3D93B;   /* accent only: buttons, ticks, rules */
    --hivis-hi:  #D2E656;
    --hivis-lo:  #A6BB28;
    --muted:     #6E756A;   /* secondary text */
    --rule:      #C9CCC1;   /* hairlines on paper */
    --rule-dark: #42563F;   /* hairlines on green */
    --on-green:        #DCE2D6;
    --on-green-soft:   #B9C8B2;
    --on-green-mute:   #A9B7A3;
    --on-ink-mute:     #8C948A;
    --body-soft: #3A423A;

    --radius: 4px;
    --radius-sm: 3px;
    --maxw: 1180px;
    --gutter: 28px;
    --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
html, body { overflow-x: clip; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.03em; line-height: 1.08; }
p { margin: 0; }
a { color: inherit; }
img, svg { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; }

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

:focus-visible { outline: 3px solid var(--hivis); outline-offset: 3px; }
[tabindex="-1"]:focus, h1:focus, h2:focus { outline: none; }

.skip {
    position: absolute; left: -9999px; top: 12px; z-index: 60;
    background: var(--hivis); color: var(--ink); padding: 10px 16px; font-weight: 600;
    border-radius: var(--radius-sm); text-decoration: none;
}
.skip:focus { left: 12px; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap > * { min-width: 0; }

.section { padding-block: 76px; }
@media (max-width: 760px) { .section { padding-block: 56px; } }

.on-green { background: var(--green); color: var(--paper); }
.on-ink   { background: var(--ink);   color: var(--paper); }
.on-card  { background: var(--card); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

/* ---------- type ---------- */
h1 { font-size: clamp(2.4rem, 5vw, 3.9rem); line-height: 1.03; letter-spacing: -.035em; }
h2 { font-size: clamp(1.85rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.015em; }

.head { max-width: 34ch; margin: 0 0 40px; }
.head h2 { margin-bottom: 14px; }
.head p { color: var(--muted); font-size: 1.05rem; max-width: 42ch; }
.on-green .head p { color: var(--on-green-soft); }

.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); line-height: 1.5; max-width: 44ch; }
.muted { color: var(--muted); }

/* A small label in the style of a form-number on a work order. */
.tag {
    display: inline-block;
    font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
}
.on-green .tag { color: var(--on-green-mute); }
.tag::before { content: ""; display: inline-block; width: 9px; height: 9px; background: var(--hivis); margin-right: 9px; vertical-align: 0; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    background: var(--hivis); color: var(--ink);
    font-family: var(--font); font-weight: 700; font-size: 1rem; line-height: 1.2;
    text-decoration: none; padding: 15px 26px;
    border-radius: var(--radius-sm); border: 2px solid var(--hivis);
    cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--hivis-hi); border-color: var(--hivis-hi); }
.btn:disabled { opacity: .7; cursor: progress; }

.btn--ghost { background: transparent; color: var(--paper); border-color: #55704F; }
.btn--ghost:hover { background: var(--green-hi); border-color: #6E8A66; }

.btn--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--ink:hover { background: #2A322A; border-color: #2A322A; }

.btn--line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--paper); }

.actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- work-order devices ---------- */
.tick {
    flex: 0 0 auto; width: 17px; height: 17px;
    border: 2px solid var(--rule); border-radius: 2px;
    margin-top: 1px; position: relative; background: #fff;
}
.tick::after {
    content: ""; position: absolute; left: 3.5px; top: -.5px; width: 5px; height: 10px;
    border: solid var(--ink); border-width: 0 2.5px 2.5px 0;
    transform: rotate(42deg) scale(0);
}
.done .tick { background: var(--hivis); border-color: var(--hivis-lo); }
.done .tick::after { transform: rotate(42deg) scale(1); }

.rule-list { list-style: none; border-top: 2px solid var(--ink); }
.rule-list > li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.on-green .rule-list { border-top-color: var(--paper); }
.on-green .rule-list > li { border-bottom-color: var(--rule-dark); }

/* ---------- forms (plain, catalog-style) ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .84rem; font-weight: 600; color: var(--body-soft); }
.field input, .field select, .field textarea {
    font-family: var(--font); font-size: 1rem; color: var(--ink);
    background: #fff; border: 1.5px solid var(--rule); border-radius: var(--radius-sm);
    padding: 11px 12px; width: 100%;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(195, 217, 59, .45);
}
.field .invalid { border-color: #B23A1E; }
.field .validation-message { font-size: .8rem; color: #B23A1E; }

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

/* ---------- Blazor error UI ---------- */
#blazor-error-ui {
    color-scheme: light;
    background: var(--ink); color: var(--paper);
    bottom: 0; box-shadow: 0 -1px 20px rgba(0,0,0,.4);
    display: none; left: 0; padding: .8rem 1.4rem; position: fixed; width: 100%; z-index: 1200;
    font-family: var(--font); font-size: .9rem;
}
#blazor-error-ui .reload { color: var(--hivis); margin-left: .5rem; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: 0.6rem; }
.blazor-error-boundary { background: var(--green); padding: 1rem; color: white; border-radius: var(--radius); }
.blazor-error-boundary::after { content: "An error has occurred." }
