/* Tender Submission Portal — mobile-first, no build step required. */

:root {
    --navy: #0b2a55;
    --navy-dark: #081e3d;
    --blue: #1d4ed8;
    --blue-soft: #e8efff;
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1b2433;
    --muted: #5b6678;
    --border: #cfd7e6;
    --error: #b42318;
    --error-bg: #fdecea;
    --success: #067647;
    --success-bg: #e7f6ee;
    --warn: #b54708;
    --warn-bg: #fff4e5;
    --radius: 10px;
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.55;
}

.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 1rem; }

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

[hidden] { display: none !important; }

/* Header / footer */
.site-header { background: var(--navy); color: #fff; padding: 0.85rem 0; }
.site-header__label { margin: 0; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.9; }
.site-footer { padding: 1.5rem 0 2.5rem; color: var(--muted); font-size: 0.875rem; text-align: center; }

/* Intro */
.intro { padding: 2rem 0 1.25rem; }
.intro h1 { margin: 0 0 0.5rem; color: var(--navy); font-size: 1.75rem; line-height: 1.2; }
.intro__subtitle { margin: 0; font-size: 1.1rem; color: var(--muted); }
.intro__description { margin: 0.75rem 0 0; }
.intro__closing { margin: 0.75rem 0 0; font-size: 0.95rem; }

/* Card + form */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(11, 42, 85, 0.05);
}

.form-section { border: 0; padding: 0; margin: 0 0 1.75rem; min-width: 0; }
.form-section legend { padding: 0; margin-bottom: 0.9rem; font-size: 1.1rem; font-weight: 600; color: var(--navy); }

.field { margin-bottom: 1.1rem; }
.field label { display: block; margin-bottom: 0.35rem; font-weight: 600; }
.required { color: var(--error); }
.muted { color: var(--muted); font-weight: 400; }

input[type="text"], input[type="email"], select {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
    color: inherit;
}

input[type="text"]:focus, input[type="email"]:focus, select:focus,
.button:focus-visible, .file-list__remove:focus-visible {
    outline: 3px solid rgba(29, 78, 216, 0.35);
    outline-offset: 1px;
    border-color: var(--blue);
}

input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--error); }

select { appearance: auto; cursor: pointer; }
select:disabled { cursor: not-allowed; opacity: 0.7; }

.field__help { margin: 0.4rem 0 0; font-size: 0.875rem; color: var(--muted); }
.field__error { margin: 0.4rem 0 0; font-size: 0.9rem; color: var(--error); font-weight: 600; }

/* Dropzone */
.dropzone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--blue-soft);
    transition: border-color 0.15s, background 0.15s;
}
.dropzone:focus-within, .dropzone.is-dragover { border-color: var(--blue); background: #dbe6ff; }

.dropzone__label {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.25rem; min-height: 11rem; padding: 1.5rem 1rem; text-align: center; cursor: pointer;
}
.dropzone__icon { font-size: 2.25rem; line-height: 1; color: var(--navy); }
.dropzone__title { font-weight: 600; color: var(--navy); font-size: 1.1rem; }
.dropzone__or { color: var(--muted); }
.dropzone__browse { color: var(--blue); text-decoration: underline; font-weight: 600; }

/* Files */
.file-summary {
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin: 1rem 0 0.4rem; font-weight: 600; color: var(--navy);
}
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0; border-bottom: 1px solid var(--border);
}
.file-list__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-list__size { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }
.file-list__remove {
    border: 1px solid var(--border); background: #fff; color: var(--error);
    border-radius: 6px; padding: 0.35rem 0.65rem; font: inherit; font-size: 0.875rem; cursor: pointer;
}
.file-list__remove:hover { background: var(--error-bg); }

.file-errors { margin: 0.75rem 0 0; padding: 0.75rem 1rem 0.75rem 2rem; background: var(--error-bg); color: var(--error); border-radius: 8px; font-size: 0.9rem; }

/* Progress */
.progress { margin-bottom: 1rem; }
.progress__label { margin-bottom: 0.4rem; font-weight: 600; color: var(--navy); }
.progress__track { height: 12px; background: #e4e9f3; border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: var(--blue); transition: width 0.2s; }
.progress__bar.is-indeterminate { width: 40%; animation: slide 1.2s infinite ease-in-out; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* Buttons + alerts */
.button {
    display: block; width: 100%;
    padding: 0.95rem 1.25rem; border: 0; border-radius: 8px;
    background: var(--navy); color: #fff; font: inherit; font-size: 1.05rem; font-weight: 600; cursor: pointer;
}
.button:hover:not(:disabled) { background: var(--navy-dark); }
.button:disabled { opacity: 0.6; cursor: not-allowed; }

.alert { padding: 0.9rem 1rem; border-radius: 8px; margin-bottom: 1.25rem; font-weight: 600; }
.alert--error { background: var(--error-bg); color: var(--error); }

/* Results */
.result { text-align: center; margin-top: 0; }
.result:focus { outline: none; }
.result h2 { margin: 0.5rem 0 1rem; color: var(--navy); font-size: 1.4rem; line-height: 1.3; }
.result__icon {
    width: 3.5rem; height: 3.5rem; margin: 0 auto; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--success-bg); color: var(--success); font-size: 1.75rem; font-weight: 700;
}
.result__icon--warn { background: var(--warn-bg); color: var(--warn); }
.result__details { margin: 1.25rem 0; text-align: left; border: 1px solid var(--border); border-radius: 8px; }
.result__details > div { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); }
.result__details > div:last-child { border-bottom: 0; }
.result__details dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.result__details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.result__reference { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.2rem; color: var(--navy); }
.result__note { background: var(--blue-soft); border-radius: 8px; padding: 0.85rem 1rem; margin: 0; text-align: left; }
.result--failure .result__note { background: var(--warn-bg); }
.result__list { text-align: left; color: var(--error); }

.site-header {
    background: #ffffff;
    border-bottom: 3px solid #0090d1;
    padding: 18px 0;
}

.site-header__branding {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-header__logo {
    width: 75px;
    height: 75px;
    object-fit: contain;
}

.site-header__identity {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.site-header__name {
    font-size: 18px;
    font-weight: 700;
    color: #17324d;
}

.site-header__label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #0090d1;
}

@media (max-width: 600px) {
    .site-header {
        padding: 12px 0;
    }

    .site-header__logo {
        width: 58px;
        height: 58px;
    }

    .site-header__name {
        font-size: 15px;
    }
}

@media (min-width: 640px) {
    .intro h1 { font-size: 2.1rem; }
    .card { padding: 2rem; }
    .result__details > div { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 1rem; }
    .button { width: auto; min-width: 16rem; margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .progress__bar, .dropzone { transition: none; }
    .progress__bar.is-indeterminate { animation: none; }
}
