@import url("https://use.typekit.net/ofa1ufl.css");

:root {
    --font: "futura-pt", Futura, "Century Gothic", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;

    /* OTEC brand */
    --otec-black: #080808;
    --otec-panel: #16171a;
    --otec-blue: #0c66b0;
    --otec-blue-bright: #00b4ff;
    --otec-red: #e71e31;

    --ink: #0a0a0a;
    --paper: #ffffff;
    --border: #e2e4e8;
    --muted: #6b6e74;

    /* Safety verdict colours — deliberately separate from the brand accent */
    --safe: #1f8a4c;
    --safe-bg: #e9f7ef;
    --monitor: #b5750a;
    --monitor-bg: #fff4e0;
    --replace: var(--otec-red);
    --replace-bg: #fdeaec;

    --radius: 10px;
    --radius-pill: 999px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.5;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--otec-blue);
}
.eyebrow::before {
    content: "";
    width: 18px;
    height: 3px;
    background: var(--otec-red);
    display: inline-block;
}

.topbar {
    background: var(--otec-black);
    color: #fff;
    padding: 16px 16px;
}
.topbar-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.logo {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--otec-blue-bright);
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
}
.logo .logo-mark {
    color: #fff;
    position: relative;
}
.logo .logo-mark::after {
    content: "";
    position: absolute;
    left: 1px;
    right: 1px;
    bottom: 0.32em;
    height: 2px;
    background: var(--otec-red);
}
.topbar-sub {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 12px;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 40px; }

.intro { margin-bottom: 4px; }
.intro h1 {
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    margin: 10px 0 10px;
    text-wrap: balance;
}
.intro p { color: var(--muted); margin: 0 0 22px; }

.card {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
}
.card h2 {
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 4px;
}
.hint { color: var(--muted); font-size: 0.88rem; margin: 0 0 14px; }
.hint-inline { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 0.85rem; }

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
@media (max-width: 480px) {
    .photo-grid { grid-template-columns: 1fr; }
}

.photo-slot input[type="file"] {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0;
    overflow: hidden;
}
.photo-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 16px 10px;
    min-height: 110px;
    cursor: pointer;
    background: #fafbfc;
    overflow: hidden;
    transition: border-color .15s ease;
}
.photo-tile:active { border-color: var(--otec-blue); }
.photo-icon { font-size: 1.6rem; }
.photo-label { font-size: 0.82rem; color: #333; }
.photo-label small { color: #93969b; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.68rem; }
.photo-preview {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.photo-slot.has-image .photo-tile { border-style: solid; border-color: var(--otec-blue); }
.photo-slot.has-image .photo-preview { display: block; }
.photo-slot.has-image .photo-icon,
.photo-slot.has-image .photo-label { position: relative; z-index: 1; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.photo-slot.has-image .photo-label small { color: #f0f0f0; }

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.field-wide { grid-column: 1 / -1; }
@media (max-width: 480px) {
    .field-grid { grid-template-columns: 1fr; }
}
.field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 5px;
    color: #333;
}
.field input, .field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--otec-blue); outline-offset: 1px; }

.btn-primary {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    background: var(--otec-blue);
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background .15s ease;
    font-family: inherit;
}
.btn-primary:hover { background: #094f88; }
.btn-primary:focus-visible { outline: 2px solid var(--otec-black); outline-offset: 2px; }
.btn-primary:disabled { background: #c9ccd0; cursor: not-allowed; }

.disclaimer { font-size: 0.75rem; color: #9a9da2; text-align: center; margin: 12px 0 0; }

.field-error { border-color: var(--replace) !important; }
.form-error {
    background: var(--replace-bg);
    color: var(--replace);
    border: 1px solid var(--replace);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.9rem;
    margin-bottom: 14px;
}

/* Results */
.results { margin-top: 24px; }

.verdict-banner {
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 16px;
}
.verdict-banner h2 {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    text-wrap: balance;
}
.verdict-banner p { margin: 0; }
.verdict-safe { background: var(--safe-bg); color: var(--safe); }
.verdict-monitor { background: var(--monitor-bg); color: var(--monitor); }
.verdict-replace { background: var(--replace-bg); color: var(--replace); }

.summary-card { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }

.defect-list { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.defect-item {
    background: var(--paper);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
}
.defect-item.sev-replace { border-left-color: var(--replace); }
.defect-item.sev-monitor { border-left-color: var(--monitor); }
.defect-item strong { display: block; margin-bottom: 2px; }
.defect-item .why { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.severity-tag {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    margin-left: 6px;
    vertical-align: middle;
}
.sev-tag-severe { background: rgba(231, 30, 49, 0.14); color: var(--replace); }
.sev-tag-moderate { background: rgba(181, 117, 10, 0.14); color: var(--monitor); }
.sev-tag-minor { background: #eef0f2; color: #555; }

.otec-card {
    background: var(--otec-black);
    color: #fff;
    border-radius: var(--radius);
    padding: 22px;
    margin-top: 18px;
}
.otec-card .otec-kicker {
    font-size: 0.68rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--otec-blue-bright);
    font-weight: 800;
}
.otec-card h3 { margin: 8px 0 6px; font-size: 1.1rem; font-weight: 900; text-transform: uppercase; }
.otec-card p { margin: 0 0 16px; color: rgba(255,255,255,0.65); font-size: 0.9rem; }
.otec-card a.btn-primary { text-decoration: none; text-align: center; }
.otec-card a.btn-primary:hover { background: var(--otec-blue-bright); color: var(--otec-black); }

.rescan-link {
    display: block;
    text-align: center;
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    font-family: inherit;
}

/* [hidden] and .loading-overlay both have (0,1,0) specificity, so without
   this the later author rule's `display: flex` would beat the browser's
   default `[hidden] { display: none }` and show the overlay on load. */
.loading-overlay[hidden] { display: none; }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 8, 0.92);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 50;
}
.loading-overlay p {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.spinner {
    width: 42px; height: 42px;
    border: 4px solid rgba(255,255,255,.2);
    border-top-color: var(--otec-blue-bright);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
    .spinner { animation: none; }
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer {
    background: var(--otec-black);
    color: rgba(255,255,255,0.45);
    text-align: center;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    padding: 22px 16px 26px;
    margin-top: 8px;
}
