/* Creo Finanz AG — Vorsorge-Check (local prototype)
   Brand colors from public creofinanz.ch Elementor CSS (not a formal brand book).
   System fonts only — official brand fonts MISSING from workspace. */

:root {
  /* Primary dark greens (public Elementor) */
  --green-dark: #11352E;
  --green-mid: #00483C;
  --green-soft: #22584E;
  /* Accent */
  --accent: #559F58;
  --accent-warm: #FFBC7D;
  /* Surfaces */
  --bg: #F1F8F2;
  --bg-soft: #E8F2EA;
  --white: #ffffff;
  --text: #2A2A2A;
  --muted: #7A7A7A;
  --error: #b33a3a;
  --shadow: 0 10px 32px rgba(17, 53, 46, 0.10);
  --shadow-sm: 0 2px 10px rgba(17, 53, 46, 0.06);
  --radius: 16px;
  --radius-sm: 12px;
  --touch: 56px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 420px;
  margin: 0 auto;
  padding: 1.15rem 1.25rem 2.75rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-top: 0.35rem;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.logo-img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 168px;
  object-fit: contain;
}

.btn-back {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--green-soft);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
}

.btn-back:hover,
.btn-back:focus-visible {
  background: var(--bg-soft);
  outline: none;
  color: var(--green-dark);
}

/* Progress */
.progress-wrap {
  margin-bottom: 1.5rem;
}

.progress {
  height: 8px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  box-shadow: inset 0 1px 2px rgba(17, 53, 46, 0.06);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green-dark), var(--accent));
  border-radius: 999px;
  transition: width 0.28s ease;
  min-width: 0;
}

.progress-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Screens */
.screen {
  flex: 1;
}

.screen.landing {
  padding-top: 0.25rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.65rem;
}

h1 {
  font-size: clamp(1.65rem, 5.2vw, 2.05rem);
  line-height: 1.22;
  margin: 0 0 0.85rem;
  color: var(--green-dark);
  font-weight: 750;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.3rem, 4vw, 1.55rem);
  line-height: 1.28;
  margin: 0 0 1.35rem;
  color: var(--green-dark);
  font-weight: 700;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 0.95rem;
  margin: 0 0 0.45rem;
  color: var(--green-dark);
  font-weight: 700;
}

.lead {
  font-size: 1.05rem;
  color: var(--text);
  margin: 0 0 1.35rem;
  opacity: 0.92;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.bullets {
  margin: 0 0 1.85rem;
  padding: 1.1rem 1.15rem 1.1rem 2.15rem;
  color: var(--text);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(17, 53, 46, 0.06);
}

.bullets li {
  margin-bottom: 0.45rem;
}

.bullets li:last-child {
  margin-bottom: 0;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--touch);
  padding: 0.95rem 1.35rem;
  border-radius: 14px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  margin-top: 0.85rem;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--green-dark);
  color: var(--white);
  box-shadow: 0 8px 24px rgba(17, 53, 46, 0.22);
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus-visible {
  background: var(--green-mid);
  outline: none;
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.985);
}

.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
  pointer-events: none;
}

.btn-secondary {
  background: var(--white);
  color: var(--green-dark);
  border-color: rgba(17, 53, 46, 0.22);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--bg-soft);
  border-color: var(--green-soft);
  outline: none;
}

/* Option buttons */
.opt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.opt-stack {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.opt-btn {
  appearance: none;
  min-height: var(--touch);
  padding: 1rem 1.1rem;
  border: 1.5px solid rgba(17, 53, 46, 0.1);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.opt-btn:hover,
.opt-btn:focus-visible {
  border-color: var(--accent);
  background: #f7fcf8;
  outline: none;
  box-shadow: 0 4px 16px rgba(85, 159, 88, 0.18);
}

.opt-btn:active {
  transform: scale(0.99);
}

/* Form fields */
.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 1.1rem 0 0.4rem;
  color: var(--green-soft);
}

.select-large,
.input-large {
  width: 100%;
  min-height: var(--touch);
  padding: 0.85rem 1.05rem;
  font: inherit;
  font-size: 1.05rem;
  border: 1.5px solid rgba(17, 53, 46, 0.12);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.select-large:focus,
.input-large:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(85, 159, 88, 0.22);
}

.field-error {
  color: var(--error);
  font-size: 0.85rem;
  margin: 0.35rem 0 0;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin: 1.35rem 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.45;
  cursor: pointer;
}

.consent-row input {
  width: 24px;
  height: 24px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--green-dark);
}

.consent-row a {
  color: var(--green-mid);
}

.privacy-note {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg-soft);
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius-sm);
  margin: 1.1rem 0;
  border: 1px solid rgba(17, 53, 46, 0.05);
}

/* Result cards — Mode A / D (metric) */
.result-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.65rem 1.35rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(17, 53, 46, 0.06);
  margin-bottom: 1.15rem;
}

.result-card.mode-a,
.result-card.mode-d {
  border-top: 4px solid var(--accent);
}

.result-card.mode-b,
.result-card.mode-c {
  border-top: 4px solid var(--green-soft);
  background: linear-gradient(180deg, #ffffff 0%, #f7fcf8 100%);
}

.mode-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--green-mid);
  background: var(--bg-soft);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin: 0 0 0.85rem;
}

.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0 0.35rem;
}

.metric-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.95rem 0.9rem;
  text-align: center;
  border: 1px solid rgba(17, 53, 46, 0.05);
}

.metric-card .metric-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.metric-card .metric-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--green-dark);
}

.metric-card.metric-gap {
  grid-column: 1 / -1;
  background: #fff8f0;
  border-color: rgba(255, 188, 125, 0.45);
}

.metric-card.metric-gap .metric-value {
  color: #9a5a20;
  font-size: 1.2rem;
}

.util-ring {
  width: 118px;
  height: 118px;
  margin: 0.35rem auto 1.15rem;
  border-radius: 50%;
  border: 9px solid var(--bg-soft);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 4px var(--white);
}

.util-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--green-dark);
  letter-spacing: -0.02em;
}

.result-line {
  margin: 0.45rem 0;
  font-size: 1rem;
  color: var(--text);
}

.result-line.gap strong {
  color: #9a5a20;
}

.result-line.longterm {
  margin-top: 0.95rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--bg-soft);
}

.info-panel {
  margin-top: 0.85rem;
  padding: 1rem 1.1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  font-size: 0.95rem;
  color: var(--text);
}

.info-panel p {
  margin: 0;
}

.info-panel p + p {
  margin-top: 0.65rem;
}

.tax-note {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(17, 53, 46, 0.06);
}

.tax-note p {
  margin: 0;
  color: var(--muted);
}

/* Thank you */
.thankyou {
  text-align: center;
  padding-top: 2.25rem;
}

.thank-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 1.35rem;
  border-radius: 50%;
  background: var(--green-dark);
  color: var(--accent-warm);
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(17, 53, 46, 0.2);
}

/* Debug panel */
.debug-panel {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #1a1a1a;
  color: #d4d4d4;
  border-radius: 10px;
  font-size: 0.75rem;
  overflow: auto;
  max-height: 280px;
}

.debug-panel h3 {
  color: var(--accent-warm);
  margin-bottom: 0.5rem;
}

.debug-panel pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Footer — trust strip */
.site-footer {
  margin-top: 2.75rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(17, 53, 46, 0.1);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
}

.site-footer .trust-line {
  margin: 0 0 0.55rem;
  color: var(--green-soft);
  font-weight: 600;
  font-size: 0.82rem;
}

.site-footer .trust-links {
  margin: 0;
}

.site-footer a {
  color: var(--green-mid);
  text-decoration: none;
  font-weight: 500;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-note {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

@media (max-width: 390px) {
  #app {
    padding: 1rem 1.05rem 2.5rem;
  }

  .opt-grid {
    grid-template-columns: 1fr;
  }

  .metrics-row {
    grid-template-columns: 1fr;
  }

  .metric-card.metric-gap {
    grid-column: auto;
  }
}

@media (min-width: 391px) and (max-width: 420px) {
  .opt-grid {
    grid-template-columns: 1fr 1fr;
  }
}


/* Phase 3D — honest submit error (not fake success) */
.submit-error {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  font-size: 0.95rem;
}
.turnstile-wrap {
  margin: 1rem 0;
  min-height: 0;
}

/* Legal pages (Impressum / Datenschutz) — mobile-first, readable */
.legal-page {
  background: var(--bg);
}
.legal-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.15rem 1.25rem 2.75rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.legal-article {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.35rem 1.25rem 1.75rem;
}
.legal-article h1 {
  margin: 0 0 0.75rem;
  color: var(--green-dark);
  font-size: 1.55rem;
  line-height: 1.25;
}
.legal-article h2 {
  margin: 1.5rem 0 0.55rem;
  color: var(--green-mid);
  font-size: 1.05rem;
  line-height: 1.35;
}
.legal-article p,
.legal-article li {
  font-size: 0.95rem;
  color: var(--text);
}
.legal-article ul {
  padding-left: 1.2rem;
  margin: 0.4rem 0 0.8rem;
}
.legal-article a {
  color: var(--green-mid);
  font-weight: 500;
}
.legal-article a:hover,
.legal-article a:focus-visible {
  color: var(--green-dark);
  text-underline-offset: 2px;
}
.legal-lead {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem !important;
}
.legal-disclaimer {
  margin: 0 0 1.25rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  font-size: 0.88rem !important;
}
.legal-address {
  font-style: normal;
  margin: 0.5rem 0 1rem;
  line-height: 1.6;
}
.legal-dl {
  margin: 0 0 1.25rem;
}
.legal-dl dt {
  font-weight: 600;
  color: var(--green-soft);
  font-size: 0.82rem;
  margin-top: 0.65rem;
}
.legal-dl dd {
  margin: 0.15rem 0 0;
}
.legal-meta {
  margin-top: 1.5rem;
  font-size: 0.85rem !important;
  color: var(--muted) !important;
}
.offen-box {
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  background: #fff8ef;
  border: 1px solid var(--accent-warm);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.offen-box strong {
  display: block;
  color: var(--green-dark);
  margin-bottom: 0.45rem;
}
.offen-box ul {
  margin: 0.35rem 0 0;
}
.legal-article code {
  font-size: 0.85em;
  background: var(--bg-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
@media (max-width: 390px) {
  .legal-wrap {
    padding: 1rem 1.05rem 2.5rem;
  }
  .legal-article {
    padding: 1.15rem 1rem 1.5rem;
  }
}

/* UX refresh 2026-10 — mobile-first, no new brand colors */

.progress {
  height: 4px;
  box-shadow: none;
  background: rgba(17, 53, 46, 0.08);
}

.progress-wrap {
  margin-bottom: 0.95rem;
}

.progress-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.screen h2 {
  margin-bottom: 0.4rem;
}

.q-sub {
  margin: 0 0 1.05rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.benefit-list {
  list-style: none;
  margin: 0.2rem 0 1.35rem;
  padding: 0.15rem 0 0;
}

.benefit-list li {
  position: relative;
  margin: 0;
  padding: 0.42rem 0 0.42rem 1.7rem;
  font-weight: 600;
  color: var(--green-dark);
}

.benefit-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.42rem;
  color: var(--accent);
  font-weight: 700;
}

.cta-note {
  margin: 0.75rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.cta-panel {
  margin-top: 0.35rem;
}

.cta-title {
  font-size: 1.22rem;
  line-height: 1.3;
}

.opt-btn.is-selected {
  border-color: var(--green-dark);
  background: #f3faf4;
  box-shadow: 0 0 0 3px rgba(85, 159, 88, 0.16);
}

.canton-list {
  max-height: 46vh;
  overflow: auto;
  margin-top: 0.7rem;
  padding-right: 2px;
}

.canton-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.canton-code {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.canton-empty {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.util-ring {
  width: 132px;
  height: 132px;
  margin: 0.15rem auto 0.95rem;
  border: none;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--pct, 0) * 1%), #e6f0e8 0);
  box-shadow: none;
}

.util-core {
  width: 102px;
  height: 102px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-card.metric-potential {
  grid-column: 1 / -1;
  margin-top: 0.15rem;
  background: #f3faf4;
  border: 1px solid rgba(85, 159, 88, 0.38);
  text-align: center;
}

.metric-card.metric-potential .metric-value {
  color: var(--green-dark);
  font-size: 1.35rem;
}

.metric-suffix {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green-soft);
}

.tax-disclaimer {
  margin-top: 0.55rem !important;
  font-size: 0.78rem;
}

.site-footer {
  margin-top: 1.35rem;
  padding-top: 0.85rem;
}

.screen-result .result-card {
  padding: 1.25rem 1.1rem 1.15rem;
}

@media (max-width: 390px) {
  .metric-card.metric-potential {
    grid-column: 1 / -1;
  }
}

@media (min-width: 800px) {
  body {
    background:
      radial-gradient(880px 380px at 50% -8%, #e5f3e8 0%, rgba(241, 248, 242, 0) 68%),
      var(--bg);
  }

  #app {
    max-width: 440px;
    min-height: auto;
    margin: 2.25rem auto 2.5rem;
    padding: 1.35rem 1.3rem 1.4rem;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(17, 53, 46, 0.06);
    border-radius: 24px;
    box-shadow: 0 18px 48px rgba(17, 53, 46, 0.06);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .screen {
    animation: creo-screen-in 0.28s ease;
  }

  @keyframes creo-screen-in {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar,
  .opt-btn,
  .btn-primary {
    transition: none;
  }
}

/* Keep the footer with the content so short steps do not open a large gap. */
.screen {
  flex: 0 0 auto;
}
