/* --- START OF FILE shared/styles.css --- */

@font-face {
  font-family: "Roboto";
  src: url("./fonts/Roboto-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("./fonts/Roboto-Medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("./fonts/Roboto-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --primary: #c4053f;
  --primary-dark: #93032f;
  --primary-soft: #f9e5ec;
  --background: #f5f5f5;
  --surface: #fff;
  --surface-soft: #fafafa;
  --text: #000;
  --muted: #555;
  --border: #d9d9d9;
  --success: #2f6b4f;
  --success-soft: #e8f3ed;
  --warning: #8a6418;
  --warning-soft: #fff7df;
  --error: #a12622;
  --error-soft: #fdeceb;
  --info: #596f7d;
  --info-soft: #edf2f4;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --md-sys-color-primary: #c4053f;
  --md-sys-color-on-primary: #fff;
  --md-sys-color-primary-container: #f9e5ec;
  --md-sys-color-on-primary-container: #59001b;
  --md-sys-color-outline: #777;
  --md-ref-typeface-brand: "Roboto";
  --md-ref-typeface-plain: "Roboto";
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--text);
  font-family: "Roboto", Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
}

.container {
  width: min(960px, calc(100% - 32px));
  margin-inline: auto;
}

.hidden {
  display: none !important;
}

/* Header & Navigation */
.site-header {
  background: var(--surface);
  border-top: 6px solid var(--primary);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
}

.header-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 34px;
  padding: 24px 0 20px;
}

.header-copy h1 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(1.55rem, 3.8vw, 2.25rem);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.header-logo {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.brand-logo {
  display: block;
  width: clamp(210px, 23vw, 270px);
  height: auto;
  object-fit: contain;
}

.header-nav {
  border-top: 1px solid #eee;
  background: var(--surface);
}

.header-nav-inner {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.back-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
}

.language-option {
  min-width: 46px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
}

.language-option:hover,
.language-option:focus-visible {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.language-option.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(196, 5, 63, 0.24);
}

/* Main Layout & Panels */
main.container {
  flex: 1;
  padding-top: 18px;
  padding-bottom: 64px;
}

.panel {
  margin: 0 0 22px;
  padding: clamp(22px, 5vw, 38px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 5px solid var(--primary);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.intro-panel {
  position: relative;
}

.project-badge {
  display: inline-block;
  margin-bottom: 16px;
  padding: 8px 13px;
  border: 1px solid #edb6c8;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.84rem;
  font-weight: 700;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.16;
  letter-spacing: -0.025em;
}

.panel h3 {
  margin: 25px 0 8px;
  font-size: 1.25rem;
}

.panel p {
  margin-top: 0;
}

/* Notices */
.notice {
  margin: 20px 0;
  padding: 17px 19px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--info);
  border-radius: 13px;
  background: var(--info-soft);
}

.notice strong {
  display: block;
  margin-bottom: 4px;
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice.warning {
  border-left-color: var(--warning);
  background: var(--warning-soft);
}

.notice.error {
  border-left-color: var(--error);
  background: var(--error-soft);
}

.notice.success {
  border-left-color: var(--success);
  background: var(--success-soft);
}

/* Progress Bar */
.progress-wrap {
  margin: 0 0 20px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  font-weight: 700;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e8e8;
}

.progress-bar {
  width: 12.5%;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.25s ease;
}

/* Form Elements & Fieldsets */
fieldset {
  margin: 24px 0;
  padding: 0;
  border: 0;
}

legend {
  width: 100%;
  margin-bottom: 11px;
  font-weight: 700;
  font-size: 1.06rem;
}

fieldset > label,
.checkbox-grid label,
.privacy-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
  font-weight: 400;
  cursor: pointer;
}

.checkbox-grid label {
  margin: 0;
}

fieldset > label:hover,
.checkbox-grid label:hover,
.privacy-row:hover {
  border-color: #c6a1ad;
  background: #fff;
}

input[type="radio"],
input[type="checkbox"] {
  margin-top: 0.28rem;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.help {
  color: var(--muted);
  font-size: 0.94rem;
}

.checkbox-grid,
.contact-grid,
.inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.conditional {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
}

.conditional fieldset {
  margin: 0;
}

.summary-line {
  margin-top: 17px;
  padding: 12px 15px;
  border-radius: 11px;
  background: var(--primary-soft);
}

hr {
  margin: 30px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 0;
  color: var(--muted);
  font-size: 0.87rem;
  text-align: center;
}

/* Material Web Components */
md-filled-button,
md-outlined-button {
  --md-filled-button-container-color: var(--primary);
  --md-filled-button-label-text-color: #fff;
  --md-filled-button-hover-state-layer-color: #fff;
  --md-outlined-button-label-text-color: var(--primary);
  --md-outlined-button-outline-color: var(--primary);
  font-family: "Roboto", Arial, sans-serif;
}

md-outlined-select,
md-outlined-text-field {
  width: 100%;
  --md-outlined-field-focus-outline-color: var(--primary);
  --md-outlined-field-focus-label-text-color: var(--primary);
  --md-sys-color-primary: var(--primary);
}

:focus-visible {
  outline: 3px solid rgba(196, 5, 63, 0.35);
  outline-offset: 3px;
}

/* Neubau: Wohnungserfassung (Step 3) */
#dwellingRows {
  display: grid;
  gap: 16px;
  margin: 22px 0;
}

.dwelling-row {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.045);
}

.dwelling-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.dwelling-row-head h3 {
  margin: 1px 0 0;
  font-size: 1.12rem;
}

.dwelling-kicker {
  display: block;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dwelling-fields {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(180px, 0.85fr) minmax(260px, 1.3fr);
  gap: 14px;
  padding: 20px 18px 18px;
}

.dwelling-fields md-outlined-select,
.dwelling-fields md-outlined-text-field {
  min-width: 0;
}

.remove-row {
  --md-outlined-button-label-text-color: var(--primary);
  --md-outlined-button-outline-color: #d7a0b2;
}

#addDwelling {
  margin-top: 2px;
}

/* Erneuerung: Wohnungsbestand (Step 3) & Kosten-Metriken (Step 6) */
.dwelling-entry-list {
  display: grid;
  gap: 14px;
  margin: 20px 0 24px;
}

.dwelling-entry-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
}

.dwelling-entry-copy {
  display: grid;
  gap: 3px;
}

.dwelling-entry-copy strong {
  font-size: 1.02rem;
}

.dwelling-entry-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

.dwelling-entry-card md-outlined-text-field {
  width: 100%;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 0;
}

.metric {
  padding: 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  background: var(--surface-soft);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 1.25rem;
  color: var(--text);
  font-weight: 700;
}

/* Resultat: klar getrennte Karten im Stil der restlichen Seite */
#result {
  padding-top: 2px;
  width: 100%;
}

.result-header {
  position: relative;
  margin: 0 0 22px;
  padding: clamp(24px, 5vw, 38px);
  border: 1px solid var(--border);
  border-left: 7px solid var(--info);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.result-header h2 {
  margin: 0 0 12px;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.18;
}

.result-header p:last-child {
  margin-bottom: 0;
}

.result-header.positive {
  border-left-color: var(--success);
  background: linear-gradient(135deg, var(--success-soft), var(--surface) 58%);
}

.result-header.open {
  border-left-color: var(--warning);
  background: linear-gradient(135deg, var(--warning-soft), var(--surface) 58%);
}

.result-header.negative {
  border-left-color: var(--error);
  background: linear-gradient(135deg, var(--error-soft), var(--surface) 58%);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.result-card {
  margin: 0;
  padding: 23px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.055);
}

.result-card.full {
  grid-column: 1 / -1;
}

.result-card h3 {
  margin: 0 0 14px;
  font-size: 1.18rem;
  color: var(--primary-dark);
}

.result-card ul {
  margin: 0;
  padding-left: 1.25rem;
}

.result-card li {
  margin: 0 0 10px;
}

.result-card li:last-child {
  margin-bottom: 0;
}

.result-card .amount {
  display: inline-block;
  margin: 6px 0 15px;
  padding: 10px 15px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
}

.mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

/* Responsive Breakpoints */
@media (max-width: 800px) {
  .dwelling-fields {
    grid-template-columns: 1fr 1fr;
  }
  .dwelling-fields md-outlined-select {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .header-top {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 0 18px;
  }
  .header-logo {
    justify-content: flex-start;
  }
  .brand-logo {
    width: min(250px, 76vw);
  }
  .header-nav-inner {
    min-height: auto;
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column-reverse;
  }
  .checkbox-grid,
  .contact-grid,
  .inline-grid,
  .metric-grid,
  .dwelling-entry-card {
    grid-template-columns: 1fr;
  }
  .progress-meta {
    flex-direction: column;
    gap: 2px;
  }
  .actions {
    align-items: stretch;
    flex-direction: column;
  }
  .actions md-filled-button,
  .actions md-outlined-button {
    width: 100%;
  }
  .panel {
    padding: 22px 18px;
  }
}

@media (max-width: 650px) {
  .dwelling-fields {
    grid-template-columns: 1fr;
  }
  .dwelling-fields md-outlined-select {
    grid-column: auto;
  }
  .dwelling-row-head {
    align-items: flex-start;
  }
  .result-grid {
    grid-template-columns: 1fr;
  }
  .result-card.full {
    grid-column: auto;
  }
  .mail-actions {
    flex-direction: column;
  }
  .mail-actions md-outlined-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}