/* SVW-Services: design based on www.svwuerenlos.ch (red #E2001A, Poppins). Mobile first. */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/poppins-700.woff2") format("woff2"); }

:root {
    --red: #E2001A;
    --red-dark: #B00014;
    --red-light: #FDECEE;
    --text: #202020;
    --muted: #5C5C5C;
    --bg: #F3F3F3;
    --surface: #FFFFFF;
    --border: #E4E4E4;
    --input-border: #C9C9C9;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 20px rgba(0, 0, 0, .06);
    --focus-ring: 0 0 0 3px rgba(226, 0, 26, .3);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Poppins", Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--red-dark); }
a:hover { color: var(--red); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 760px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Header and footer */

.site-header { background: var(--red); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; padding: 8px 0; }
.brand:hover { color: #fff; }
.brand img { width: 52px; height: 53px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.1rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.brand-text span { font-size: .85rem; opacity: .92; }

.main { flex: 1; padding-top: 24px; padding-bottom: 48px; }

.site-footer { background: var(--red); color: #fff; font-size: .85rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 16px; padding-bottom: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer a { color: #fff; text-decoration: none; text-transform: uppercase; letter-spacing: .03em; }
.site-footer a:hover { text-decoration: underline; color: #fff; }

/* Admin header */

.admin-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.admin-nav a { color: #fff; text-decoration: none; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.admin-nav a:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.admin-nav a.is-active { background: rgba(0, 0, 0, .18); }
.user-menu { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.user-menu form { margin: 0; }
.user-menu button { background: transparent; border: 1px solid rgba(255, 255, 255, .7); color: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; }
.user-menu button:hover { background: rgba(255, 255, 255, .15); }

/* Cards and buttons */

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 20px; }
.card > h2:first-child { margin-top: 0; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 22px;
    font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; text-align: center;
    border: 2px solid transparent; border-radius: 8px; cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--input-border); }
.btn-secondary:hover { border-color: var(--text); color: var(--text); }
.btn-dark { background: var(--text); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--red-dark); text-decoration: underline; cursor: pointer; }

.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; text-decoration: none; font-weight: 500; }

/* Alerts */

.alert { border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; }
.alert-success { background: #E6F4E7; color: #1E5E22; }
.alert-error { background: var(--red-light); color: var(--red-dark); }
.alert-info { background: #E8F1FB; color: #164C85; }

/* Forms */

.field { margin-bottom: 20px; }
.field > label, .field > .label, fieldset > legend { display: block; font-weight: 500; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--muted); font-size: .875rem; }
.hint { color: var(--muted); font-size: .875rem; margin: -2px 0 8px; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }

input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=search], select, textarea {
    width: 100%; min-height: 48px; padding: 11px 14px;
    font: inherit; color: var(--text); background: #fff;
    border: 1.5px solid var(--input-border); border-radius: 8px;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: var(--focus-ring); }
.input-validation-error { border-color: var(--red) !important; background: #FFF8F9; }
.field-validation-error { display: block; color: var(--red-dark); font-size: .875rem; font-weight: 500; margin-top: 6px; }
.field-validation-valid { display: none; }
.validation-summary-errors { background: var(--red-light); color: var(--red-dark); border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; }
.validation-summary-errors ul { margin: 0; padding-left: 20px; }
.validation-summary-valid { display: none; }
.form-row { display: grid; gap: 0 16px; }

.choice-list { display: grid; gap: 10px; }
.choice, .check {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; background: #fff;
    border: 1.5px solid var(--input-border); border-radius: 10px; cursor: pointer;
    font-weight: 500;
}
.check { align-items: flex-start; font-weight: 400; }
.choice:hover, .check:hover { border-color: var(--text); }
.choice:has(input:checked), .check:has(input:checked) { border-color: var(--red); background: var(--red-light); }
.choice input, .check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--red); }
.check input { margin-top: 2px; }
.choice-list.has-error .choice { border-color: var(--red); }
[hidden] { display: none !important; }

/* Wizard */

.wizard-progress { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 8px; }
.wizard-progress li { flex: 1; height: 6px; border-radius: 3px; background: var(--border); }
.wizard-progress li.is-done, .wizard-progress li.is-current { background: var(--red); }
.wizard-step-label { font-size: .875rem; color: var(--muted); margin: 0 0 20px; }
.wizard-step h2 { font-size: 1.25rem; margin-bottom: 4px; }
.wizard-step h2:focus { outline: none; box-shadow: none; }
.wizard-step .step-intro { color: var(--muted); margin-bottom: 20px; }
.js .wizard-step { display: none; }
.js .wizard-step.is-active { display: block; }
.wizard-nav { display: flex; flex-direction: column-reverse; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.wizard-nav .btn { width: 100%; }
.wizard-nav [hidden] { display: none; }

.summary { display: grid; grid-template-columns: 1fr; gap: 2px 16px; margin: 0 0 24px; padding: 16px; background: var(--bg); border-radius: 10px; }
.summary dt { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.summary dt:first-child { margin-top: 0; }
.summary dd { margin: 0; font-weight: 500; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Start page */

.hero { margin: 8px 0 28px; }
.hero h1 { font-size: 1.8rem; }
.hero p { font-size: 1.05rem; color: var(--muted); max-width: 640px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 10px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; color: var(--text); text-decoration: none; border: 2px solid transparent; transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--red); color: var(--text); transform: translateY(-2px); }
.tile h2 { margin: 0; font-size: 1.15rem; }
.tile p { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.tile .tile-action { color: var(--red-dark); font-weight: 600; }
.icon-circle { width: 52px; height: 52px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.icon-circle svg { width: 26px; height: 26px; }
.info-box { margin-top: 32px; display: flex; gap: 14px; align-items: flex-start; }

/* Confirmation and status */

.result { text-align: center; padding: 32px 20px; }
.result .icon-circle { margin: 0 auto 16px; width: 64px; height: 64px; }
.result .icon-circle svg { width: 32px; height: 32px; }
.reference { font-family: Consolas, "Courier New", monospace; font-size: .95rem; background: var(--bg); padding: 2px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: 1fr; gap: 2px 20px; margin: 0; }
.facts dt { color: var(--muted); font-size: .875rem; margin-top: 10px; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.reply { border-left: 3px solid var(--red); padding: 4px 0 4px 14px; margin: 16px 0; }
.reply .meta { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }

/* Status badges */

.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.status-new { background: #E3EEFB; color: #154A86; }
.status-in-progress { background: #FFF1D1; color: #7A4F00; }
.status-waiting-list { background: #EFE7FA; color: #5B3391; }
.status-closed { background: #E4F2E5; color: #22622A; }

/* Admin: overview */

.page-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-title h1 { margin: 0; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.tabs a { white-space: nowrap; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--text); font-weight: 500; background: #fff; border: 1.5px solid var(--border); }
.tabs a:hover { border-color: var(--text); }
.tabs a.is-active { background: var(--text); border-color: var(--text); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--text); background: #fff; border: 1.5px solid var(--border); font-size: .9rem; font-weight: 500; }
.chip:hover { border-color: var(--text); color: var(--text); }
.chip.is-active { border-color: var(--red); background: var(--red-light); }
.chip .count { background: var(--bg); border-radius: 999px; padding: 0 8px; font-size: .8rem; }
.chip.is-active .count { background: #fff; }
.filters { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 20px; }
.filters .field { margin: 0; }
.filters label { font-size: .85rem; font-weight: 500; display: block; margin-bottom: 4px; }
.filter-actions { display: flex; gap: 10px; align-items: flex-end; }

.request-table { width: 100%; border-collapse: collapse; }
.request-table thead { display: none; }
.request-table tr { display: block; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.request-table td { display: block; padding: 3px 0; }
.request-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .85rem; }
.request-table td.cell-main::before, .request-table td.cell-status::before { content: none; }
.request-title { font-weight: 600; text-decoration: none; color: var(--text); font-size: 1.02rem; }
.request-title:hover { color: var(--red-dark); text-decoration: underline; }
.request-sub { font-size: .875rem; color: var(--muted); }
.inline-assign { display: flex; gap: 6px; margin-top: 6px; }
.inline-assign select { min-height: 38px; padding: 6px 10px; font-size: .9rem; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }

/* Admin: details */

.detail-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.detail-header h1 { margin-bottom: 4px; }
.eyebrow { font-size: .875rem; color: var(--muted); font-weight: 500; margin: 0 0 4px; }
.detail-header .badge { font-size: .95rem; padding: 6px 14px; }
.action-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.action-bar form { margin: 0; }
.action-bar .assign-form { display: flex; gap: 8px; flex: 1 1 280px; }
.action-bar .assign-form select { min-height: 38px; padding: 6px 10px; }
.action-bar .request-action { flex: 1 1 100%; display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.action-bar .request-action label { font-weight: 600; }
.action-bar .request-action textarea { min-height: 80px; }
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.detail-grid .card + .card { margin-top: 0; }
.detail-column { display: grid; gap: 20px; align-content: start; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist form { margin: 0; }
.checklist button { width: 100%; display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px 14px; font: inherit; background: #fff; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; }
.checklist button:hover { border-color: var(--text); }
.checklist button[disabled] { cursor: default; }
.checklist .box { width: 22px; height: 22px; border: 2px solid var(--input-border); border-radius: 5px; flex: none; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.checklist .is-done .box { background: var(--red); border-color: var(--red); color: #fff; }
.checklist .is-done .text { text-decoration: line-through; color: var(--muted); }
.checklist .done-by { display: block; font-size: .8rem; color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 20px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--red); }
.timeline time { display: block; font-size: .8rem; color: var(--muted); }
.timeline .actor { font-weight: 600; }

.coordinator-card + .coordinator-card { margin-top: 20px; }
.participants { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }

.login-card { max-width: 440px; margin: 24px auto; }

/* Larger screens */

@media (min-width: 640px) {
    .form-row.two { grid-template-columns: 1fr 1fr; }
    .form-row.address { grid-template-columns: 120px 1fr; }
    .wizard-nav { flex-direction: row; justify-content: space-between; }
    .wizard-nav .btn { width: auto; }
    .wizard-nav [data-wizard-next], .wizard-nav [data-wizard-submit] { margin-left: auto; }
    .summary, .facts { grid-template-columns: minmax(140px, 220px) 1fr; }
    .summary dt, .facts dt { margin-top: 0; }
    .filters { grid-template-columns: 2fr 1fr 1fr 1fr auto; align-items: end; }
}

@media (min-width: 860px) {
    h1 { font-size: 2rem; }
    .hero h1 { font-size: 2.3rem; }
    .card { padding: 28px; }
    .main { padding-top: 36px; }

    .request-table { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
    .request-table thead { display: table-header-group; }
    .request-table tr { display: table-row; box-shadow: none; border-radius: 0; padding: 0; margin: 0; }
    .request-table tbody tr { border-top: 1px solid var(--border); }
    .request-table tbody tr:hover { background: #FAFAFA; }
    .request-table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 12px 16px; background: #FAFAFA; }
    .request-table td { display: table-cell; padding: 14px 16px; vertical-align: top; }
    .request-table td[data-label]::before { content: none; }

    .detail-grid { grid-template-columns: 3fr 2fr; }
}
