/* ── Self-hosted "Outfit" font (no external requests, GDPR-compliant) ─────── */
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/outfit-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/outfit-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*, *::before, *::after { box-sizing: border-box; }

:root, body.theme-octo {
    --brand-primary: #00417F;
    --brand-primary-hover: #002F5B;
    --brand-header-bg: #ffffff;
    --brand-header-border: 1px solid #ddd;
    --brand-header-text: #000000;
    --brand-footer-bg: #002F5B;
    --brand-btn-bg: #000000;
    --brand-btn-color: #ffffff;
    --brand-btn-hover-bg: #1a1a1a;
    --brand-font: "Frutiger Light", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --brand-radius: 1em;
    --brand-input-border: 1px solid #000000;
    --brand-input-focus-shadow: rgba(0, 65, 127, 0.13);
    --brand-logo-height: 90px;
    --brand-legend-color: #00417F;
    --brand-legend-border: 2px solid #00417F;
}

body.theme-cosy {
    --brand-primary: #E7A569;
    --brand-primary-hover: #d69458;
    --brand-header-bg: #E7A569;
    --brand-header-border: none;
    --brand-header-text: #000000;
    --brand-footer-bg: #1F1F1F;
    --brand-btn-bg: #E7A569;
    --brand-btn-color: #ffffff;
    --brand-btn-hover-bg: #d69458;
    --brand-font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --brand-radius: 4px;
    --brand-input-border: 1px solid #cccccc;
    --brand-input-focus-shadow: rgba(231, 165, 105, 0.25);
    --brand-logo-height: 38px;
    --brand-legend-color: #000000;
    --brand-legend-border: 2px solid #E7A569;
}

body {
    margin: 0;
    font-family: var(--brand-font);
    font-size: 16px;
    color: #000;
    background: #fff;
    line-height: 1.6;
}

a { color: var(--brand-primary); }

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
    background: var(--brand-header-bg);
    border-bottom: var(--brand-header-border);
    padding: 16px 0;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
    gap: 16px;
}
.header-tagline img { height: 72px; width: auto; }
.header-logo img    { height: var(--brand-logo-height); max-height: 90px; width: auto; display: block; }
.header-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}
.header-nav a {
    text-decoration: none;
    color: var(--brand-header-text);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 600;
}
.header-nav a:hover { opacity: 0.8; }
.lang-toggle {
    border: 1.5px solid var(--brand-header-text);
    padding: 4px 12px;
    border-radius: 4px;
}
@media (max-width: 640px) {
    .header-tagline { display: none; }
    .header-inner   { gap: 12px; }
}

/* ── Page content ────────────────────────────────────────────────────── */
.page-content {
    padding: 52px 0 72px;
}
.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 28px;
}
.page-title {
    font-size: 2rem;
    font-weight: bold;
    color: #000;
    margin: 0 0 10px;
}
.page-intro {
    color: #444;
    margin: 0 0 8px;
    max-width: 680px;
}
.required-hint {
    font-size: 0.82rem;
    color: #777;
    margin: 0 0 36px;
}

/* ── Alert messages ──────────────────────────────────────────────────── */
.alert {
    padding: 16px 22px;
    border-radius: 10px;
    margin-bottom: 36px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.alert-success {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}
.alert-success a {
    color: #1b5e20;
    font-weight: bold;
}
.alert-error {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}
.alert-error a { color: #e65100; }
.alert-warning {
    background: #fff8e1;
    color: #5d4037;
    border: 1px solid #ffe082;
}
.alert-warning a { color: #5d4037; }

/* ── Form sections ───────────────────────────────────────────────────── */
fieldset {
    border: none;
    border-top: var(--brand-legend-border);
    padding: 22px 0 4px;
    margin: 0 0 36px;
}
legend {
    color: var(--brand-legend-color);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0 14px 0 0;
}

/* ── Form fields ─────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 0.88rem;
    color: #333;
    margin-bottom: 7px;
}
.form-group label .req {
    color: #c00;
    margin-left: 2px;
}
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 11px 18px;
    border: var(--brand-input-border);
    border-radius: var(--brand-radius);
    font-family: inherit;
    font-size: 0.95rem;
    color: #000;
    background: #fff;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    -webkit-appearance: none;
    appearance: none;
}
input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-input-focus-shadow);
}
textarea {
    border-radius: var(--brand-radius);
    resize: vertical;
    min-height: 140px;
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath d='M1 1.5l7 7 7-7' stroke='%23333' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 11px;
    padding-right: 44px;
    cursor: pointer;
}
input::placeholder,
textarea::placeholder { color: #757575; }

/* ── Muted select options (placeholders / "not listed") ───────────────── */
select option.option-muted { color: #999; }

/* ── Two-column row ──────────────────────────────────────────────────── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 580px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ── Conditional fields ──────────────────────────────────────────────── */
.field-conditional { display: none; }
.field-conditional.visible { display: block; }

/* ── Radio group ─────────────────────────────────────────────────────── */
.radio-group {
    display: flex;
    gap: 28px;
    padding: 6px 4px;
    flex-wrap: wrap;
}
.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 1rem;
    color: #000;
    margin: 0;
}
.radio-group input[type="radio"] {
    width: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    -webkit-appearance: auto;
    appearance: auto;
    margin: 0;
    cursor: pointer;
    accent-color: var(--brand-primary);
}

/* ── File upload ─────────────────────────────────────────────────────── */
input[type="file"] {
    border-radius: var(--brand-radius);
    border-style: dashed;
    border-color: #aaa;
    background: #fafafa;
    padding: 14px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
}
input[type="file"]:focus { border-color: var(--brand-primary); }
.field-hint {
    font-size: 0.78rem;
    color: #888;
    margin-top: 7px;
    padding-left: 4px;
}

/* ── Privacy checkbox ────────────────────────────────────────────────── */
.privacy-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 6px 0 30px;
}
.privacy-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    padding: 0;
    border: 1.5px solid #000;
    border-radius: 3px;
    margin-top: 3px;
    cursor: pointer;
    -webkit-appearance: auto;
    appearance: auto;
    accent-color: var(--brand-primary);
}
.privacy-group .privacy-label {
    font-size: 0.88rem;
    color: #333;
    line-height: 1.55;
}

/* ── Submit button ───────────────────────────────────────────────────── */
.btn-submit {
    width: 100%;
    padding: 15px;
    background: var(--brand-btn-bg);
    color: var(--brand-btn-color);
    border: none;
    border-radius: var(--brand-radius);
    font-family: inherit;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.18s;
}
.btn-submit:hover:not(:disabled) { background: var(--brand-btn-hover-bg); }
.btn-submit:disabled {
    background: #999;
    cursor: not-allowed;
}
/* ── Field error state ──────────────────────────────────────────── */
.has-error {
    border-color: #c00 !important;
    box-shadow: 0 0 0 3px rgba(200, 0, 0, 0.1) !important;
}
.field-error-msg {
    color: #c00;
    font-size: 0.78rem;
    margin-top: 5px;
    padding-left: 4px;
}

/* ── File upload: one-by-one ─────────────────────────────────────── */
.file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.file-row .file-input { flex: 1; }
.btn-remove-file {
    flex-shrink: 0;
    background: none;
    border: 1px solid #c00;
    color: #c00;
    border-radius: 1em;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
}
.btn-remove-file:hover { background: #fff0f0; }
.btn-add-file {
    display: inline-block;
    background: none;
    border: 1.5px solid var(--brand-primary);
    color: var(--brand-primary);
    border-radius: 1em;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    margin-top: 4px;
}
.btn-add-file:hover    { background: #f0f5ff; }
.btn-add-file:disabled { opacity: 0.45; cursor: not-allowed; }
/* ── Honeypot (invisible to humans) ──────────────────────────────────── */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    pointer-events: none;
    tab-index: -1;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--brand-footer-bg);
    color: #fff;
    padding: 36px 0;
    text-align: center;
}
.site-footer nav {
    display: flex;
    justify-content: center;
    gap: 36px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    padding: 0 24px;
}
.site-footer nav a {
    color: #fff;
    text-decoration: none;
    font-size: 0.82rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.site-footer nav a:hover { text-decoration: underline; }
.site-footer .copyright {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
}
