/* ==========================================================
   Theme colors – change these to match the logo exactly.
   ========================================================== */
:root {
  --color-accent: #2e7d32;        /* green accent (buttons, highlights) */
  --color-accent-hover: #256628;  /* darker green for hover/active */
  --color-text: #111;             /* main text color */
  --color-muted: #666;            /* secondary text */
  --color-border: #ddd;           /* dividers and input borders */
  --color-bg: #fff;               /* page background */
  --color-error: #c62828;         /* validation errors */
  --color-notice-bg: #fff8e1;     /* notice box background */
  --color-notice-border: #f0c36d; /* notice box border */
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

[hidden] { display: none !important; }

/* Centered single-column layout */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

/* ---------- Logo ---------- */
.logo {
  display: flex;
  justify-content: center;
  margin: 8px 0 24px;
}
/* On sub-pages the logo is a link home: only the logo itself is clickable */
a.logo {
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  text-decoration: none;
}
a.logo:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; }
.logo img {
  display: block;
  max-width: 320px;
  max-height: 100px;
  height: auto;
}
/* Shown instead of the image if images/logo.png is missing */
.logo-placeholder {
  width: 220px;
  height: 80px;
  border: 2px dashed var(--color-border);
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.2em;
}

/* ---------- Gear (settings) button ---------- */
/* Sits on the right of the "Lokale" heading row */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-head h2 { margin: 0; }

.gear {
  flex-shrink: 0;
  width: 44px;
  margin: -10px -10px -10px 0; /* keep a large tap area without adding row height */
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-text);
}
.gear:hover,
.gear:focus-visible { color: var(--color-accent); background: #f3f3f3; }
.gear svg { width: 26px; height: 26px; }

/* ---------- Headings & sections ---------- */
h1 { font-size: 1.6rem; margin: 0 0 16px; text-align: center; }
h2 { font-size: 1.15rem; margin: 0 0 10px; }

.section { padding: 16px 0; }

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 0;
}

/* ---------- Form fields ---------- */
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem; /* 16px avoids zoom-on-focus on iOS */
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
}
.field input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}
.field input[aria-invalid="true"] { border-color: var(--color-error); }

/* Two fields side by side (Antal / Tid) */
.row {
  display: flex;
  gap: 12px;
}
.row .field { flex: 1; min-width: 0; }

/* "Grundig" checkbox row */
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
}
.check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.error {
  display: block;
  color: var(--color-error);
  font-size: 0.85rem;
  margin-top: 4px;
}
.error:empty { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  margin-top: 16px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--color-accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.btn:hover,
.btn:focus-visible { background: var(--color-accent-hover); }

.btn-secondary {
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border);
}
.btn-secondary:hover,
.btn-secondary:focus-visible { background: #f3f3f3; }

/* ---------- Messages ---------- */
.notice {
  padding: 10px 12px;
  margin: 0 0 8px;
  font-size: 0.9rem;
  background: var(--color-notice-bg);
  border: 1px solid var(--color-notice-border);
  border-radius: 6px;
}
.notice a { color: var(--color-accent); }

.success {
  margin-top: 12px;
  text-align: center;
  color: var(--color-accent);
  font-weight: 600;
}

/* ---------- Quote breakdown ---------- */
.breakdown {
  list-style: none;
  padding: 0;
  margin: 0;
}
.breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}
.breakdown li.divider {
  padding: 0;
  border-top: 1px solid var(--color-border);
  margin: 6px 0;
}
.breakdown .amount {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.breakdown li.total {
  font-size: 1.3rem;
  font-weight: 700;
}
.breakdown li.total .amount { color: var(--color-accent); }

/* "Grundig" note under the Borde/Stole line */
.breakdown li.note {
  padding: 0 0 10px;
  margin-top: -6px;
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* Customer name under "Tilbudspris" (same weight/size as "Total inkl. moms") */
.customer {
  margin: 0 0 12px;
  text-align: left;
  font-size: 1.3rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.empty { text-align: center; color: var(--color-muted); }

/* ---------- Print / "Gem som PDF" ---------- */
@media print {
  .no-print { display: none !important; }
  .container { max-width: none; padding: 0; }
  /* Keep the green on the total when printing */
  .breakdown li.total .amount {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
