/* Build Co Site Access portal - mobile-first */
:root {
    --orange: #FF6B00;
    --orange-hover: #FF8C40;
    --bg: #121212;
    --card: #1E1E1E;
    --line: #333333;
    --text: #FFFFFF;
    --muted: #B0B0B0;
    --green: #19b56b;
    --red: #e05252;
    --amber: #f4b400;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

/* Header */
.p-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 3px solid var(--orange);
    background: #0d0d0d;
}
.p-brand { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.p-brand .dot { color: var(--orange); }
.p-brand-sub { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; color: var(--muted); }

/* Layout */
#app { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 18px 16px 30px; }
.p-foot { text-align: center; color: #666; font-size: 11px; padding: 14px; }

.p-screen { display: flex; flex-direction: column; gap: 14px; }

/* Project banner */
.p-project {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 5px solid var(--orange);
    border-radius: 10px;
    padding: 14px 16px;
}
.p-project h1 { font-size: 20px; line-height: 1.2; }
.p-project p { color: var(--muted); font-size: 13px; margin-top: 4px; }

h2.p-title { font-size: 22px; margin-top: 6px; }
p.p-sub { color: var(--muted); font-size: 14px; line-height: 1.45; }

/* Big action buttons */
.p-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 60px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: var(--card);
    border: 1px solid var(--line);
    transition: filter .12s ease;
}
.p-btn:active { filter: brightness(1.25); }
.p-btn-primary { background: var(--orange); border-color: var(--orange); }
.p-btn-green { background: var(--green); border-color: var(--green); }
.p-btn-outline { background: transparent; border: 2px solid var(--line); color: var(--muted); min-height: 50px; font-size: 15px; }
.p-btn:disabled { opacity: .45; }
.p-btn .icn { font-size: 22px; line-height: 1; }

/* Inputs */
.p-field { display: flex; flex-direction: column; gap: 6px; }
.p-field label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.p-field input, .p-field select, .p-field textarea {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    font-size: 17px;
    padding: 14px;
    width: 100%;
}
.p-field input:focus, .p-field select:focus, .p-field textarea:focus { outline: none; border-color: var(--orange); }
input.p-big { font-size: 24px; text-align: center; letter-spacing: 2px; font-weight: 700; }

/* Checks / declarations */
.p-check {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
}
.p-check input { width: 26px; height: 26px; flex: 0 0 26px; accent-color: var(--orange); margin-top: 1px; }
.p-check span { font-size: 15px; line-height: 1.4; }

/* Status pills / cards */
.p-pill {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.pill-green { background: rgba(25,181,107,.15); color: var(--green); border: 1px solid var(--green); }
.pill-amber { background: rgba(244,180,0,.13); color: var(--amber); border: 1px solid var(--amber); }
.pill-red   { background: rgba(224,82,82,.13); color: var(--red); border: 1px solid var(--red); }
.pill-grey  { background: rgba(176,176,176,.12); color: var(--muted); border: 1px solid var(--line); }

.p-note {
    background: rgba(244,180,0,.09);
    border: 1px solid rgba(244,180,0,.5);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.45;
}
.p-note.err { background: rgba(224,82,82,.09); border-color: var(--red); }

/* Result screens */
.p-result { text-align: center; padding: 26px 10px 10px; }
.p-result .p-tick {
    width: 92px; height: 92px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
    font-size: 46px;
    background: var(--green);
}
.p-result .p-tick.out { background: var(--orange); }
.p-result .p-tick.warn { background: var(--amber); color: #121212; }
.p-result h2 { font-size: 24px; margin-bottom: 6px; }
.p-result p { color: var(--muted); font-size: 15px; line-height: 1.5; }
.p-result .p-when { color: var(--text); font-weight: 700; margin-top: 8px; }

/* SWMS list */
.p-doc {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.p-doc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.p-doc-title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.p-doc-actions { display: flex; gap: 8px; }
.p-doc-actions .p-btn { min-height: 46px; font-size: 14px; border-radius: 9px; }

/* Site rules box */
.p-rules {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
    font-size: 14px;
    color: var(--muted);
    white-space: pre-wrap;
    line-height: 1.5;
    max-height: 180px;
    overflow-y: auto;
}

/* Spinner */
.p-spinner {
    width: 44px; height: 44px;
    border: 4px solid var(--line);
    border-top-color: var(--orange);
    border-radius: 50%;
    margin: 60px auto;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.p-row { display: flex; gap: 10px; }
.p-row > * { flex: 1; }

a { color: var(--orange); }
