/* Invalbal – house style
 * Colors from the Invalbal logo sheet: antraciet #1E2D32, amber #F4A21C, white.
 * Layout follows the PhosMega Intermod Tool: dark header, cards, footer with amber line.
 * Mobile first: most members use the site as an app on their phone.
 */

:root {
  --amber: #f4a21c;
  --amber-dark: #d98a08;
  --amber-soft: #fff4e0;
  --antraciet: #1e2d32;
  --antraciet-light: #2c4047;
  --background: #f3f4f3;
  --surface: #ffffff;
  --border: #dfe3e2;
  --text: #1e2d32;
  --muted: #66767a;
  --danger: #c0392b;
  --success: #2e8b57;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--text);
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--antraciet); text-decoration-color: var(--amber); text-underline-offset: 3px; }
a:hover { color: var(--amber-dark); }

h1, h2, h3 { font-weight: 600; margin: 0 0 12px; line-height: 1.25; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }

.muted { color: var(--muted); }
.small { font-size: 0.85em; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* --- Header ---------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 20px;
  background: var(--antraciet);
  color: #fff;
}

.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.brand:hover { color: #fff; }
.brand-mark { height: 30px; width: auto; display: block; }
.brand-club {
  font-size: 0.9rem; font-weight: 500; color: #cfd8da;
  border-left: 1px solid #4b5f65; padding-left: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.site-nav { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; }
.site-nav a, .site-nav .link-button { color: #fff; text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.site-nav a:hover, .site-nav .link-button:hover, .site-nav a.active { color: var(--amber); }
.lang-switch { font-size: 0.8rem; color: #9fb0b4; }
.lang-switch a { font-weight: 400; font-size: 0.8rem; }
.lang-switch .current { color: var(--amber); font-weight: 600; }

.link-button { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: inherit; }
.inline-form { display: inline; margin: 0; }

/* --- Main ------------------------------------------------------------------ */

main.page { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 22px 14px 40px; }
main.page.wide { max-width: 1240px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px;
  margin-bottom: 16px;
}
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.card.accent { border-left: 5px solid var(--amber); }
.card-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 8px; }
.card-header h1, .card-header h2 { margin: 0; }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; border-left: 4px solid var(--antraciet); background: #fff; }
.flash-error { border-color: var(--danger); background: #fdf0ee; }
.flash-success { border-color: var(--success); background: #eef8f2; }
.flash-info { border-color: var(--amber); background: var(--amber-soft); }

.hero { text-align: center; padding: 28px 18px; }
.hero img { max-width: 360px; width: 80%; height: auto; }
.hero .tagline { font-size: 1.3rem; font-weight: 500; margin: 14px 0 6px; }

/* --- Forms and buttons ----------------------------------------------------- */

.stacked-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; }
.stacked-form label, .field { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
.stacked-form label.checkbox, label.checkbox { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: 0.92em; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.85em; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0; }
legend { font-weight: 600; padding: 0 6px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="url"], select, textarea {
  font: inherit;
  color: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  width: 100%;
  min-width: 0;
}
input[type="number"].narrow-input { width: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--amber); outline-offset: -1px; border-color: var(--amber); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--amber-dark); width: 18px; height: 18px; margin: 2px 0 0; flex: none; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--antraciet);
  background: #fff;
  color: var(--antraciet);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover { background: #eef1f1; color: var(--antraciet); }
.button.primary { background: var(--amber); border-color: var(--amber); color: var(--antraciet); }
.button.primary:hover { background: var(--amber-dark); border-color: var(--amber-dark); }
.button.dark { background: var(--antraciet); color: #fff; }
.button.dark:hover { background: var(--antraciet-light); color: #fff; }
.button.danger { border-color: var(--danger); color: var(--danger); }
.button.danger:hover { background: #fdf0ee; }
.button.small { padding: 3px 10px; font-size: 0.85em; }
.button.big { padding: 12px 26px; font-size: 1.05rem; }
.button[disabled] { opacity: 0.5; cursor: default; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Toggle chips: a checkbox/radio styled as a pill (attributes in profile and request form). */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-weight: 400; font-size: 0.92em; user-select: none;
}
.chip input:checked + span { background: var(--amber); border-color: var(--amber); font-weight: 500; }
.chip input:focus-visible + span { outline: 2px solid var(--antraciet); }
.chip.secondary input:checked + span { background: var(--amber-soft); border-color: var(--amber); }

/* --- Lists and tables ------------------------------------------------------ */

.table-wrap { overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; }
.data-table th, .data-table td { padding: 8px 8px; border-bottom: 1px solid #edf0ef; text-align: left; vertical-align: top; }
.data-table thead th { font-weight: 500; font-size: 0.85em; border-bottom: 2px solid var(--amber); white-space: nowrap; }
.data-table td.actions { white-space: nowrap; }

.item-list { list-style: none; margin: 0; padding: 0; }
.item-list > li { padding: 12px 0; border-bottom: 1px solid #edf0ef; }
.item-list > li:last-child { border-bottom: 0; }
.item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.item-title { font-weight: 600; }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }

/* --- Badges ---------------------------------------------------------------- */

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78em; font-weight: 500; white-space: nowrap; background: #eceff0; color: var(--muted); }
.badge.amber, .status-open { background: var(--amber-soft); color: #a3650a; }
.badge.green, .status-resolved, .answer-yes { background: #e6f4ec; color: var(--success); }
.badge.red, .answer-no { background: #fbe5e2; color: var(--danger); }
.status-closed { background: #e3ecf5; color: #2f5d87; }
.status-withdrawn, .answer-none { background: #eceff0; color: var(--muted); }
.badge.dark { background: var(--antraciet); color: #fff; }

/* --- Request form ---------------------------------------------------------- */

.line-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; background: #fbfcfc; }
.line-card .line-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.line-card .line-count { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.line-card .attr-row { margin: 6px 0; }
.line-card .attr-name { font-size: 0.85em; color: var(--muted); margin-bottom: 3px; }
.line-result { margin-left: auto; font-weight: 600; }
.line-result.zero { color: var(--danger); }

/* --- Ranking --------------------------------------------------------------- */

.candidate { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #edf0ef; }
.candidate:last-child { border-bottom: 0; }
.candidate .score { min-width: 44px; text-align: center; font-weight: 700; font-size: 1.1rem; background: var(--amber-soft); border-radius: 8px; padding: 4px 6px; }
.candidate.preferred .score { background: var(--amber); }
.candidate .who { flex: 1; min-width: 0; }
.reasons { list-style: none; padding: 0; margin: 4px 0 0; font-size: 0.82em; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 12px; }
.reasons .plus { color: var(--success); }
.reasons .minus { color: var(--danger); }
.warning-text { color: #a3650a; font-size: 0.85em; }

/* --- Install instructions -------------------------------------------------- */

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.steps li::before {
  content: counter(step); flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--amber); color: var(--antraciet); font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.steps svg { vertical-align: middle; }
.os-tabs { display: flex; gap: 6px; margin-bottom: 14px; }

/* --- Footer: PhosMega logo bottom-left, rising sun bottom-right, amber line - */

.site-footer { background: var(--antraciet); margin-top: auto; color: #cfd8da; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 14px 20px 8px; }
.footer-logo img { height: 30px; display: block; }
.footer-text { font-size: 0.8rem; text-align: center; flex: 1; }
.footer-text a { color: #cfd8da; }
.footer-sun { height: 24px; display: block; }
.footer-line { height: 4px; background: var(--amber); }

@media (max-width: 560px) {
  body { font-size: 14px; }
  .site-header { padding: 10px 14px; }
  .brand-mark { height: 26px; }
  .card { padding: 14px 14px; }
  .footer-text { display: none; }
  .details { grid-template-columns: 1fr; gap: 0; }
  .details dd { margin-bottom: 6px; }
}
