@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Source+Sans+Pro:wght@400;600;700&display=swap');

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

body {
  font-family: 'Source Sans Pro', -apple-system, sans-serif;
  background: #f7ede7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #2d1515;
}

/* ── Header ── */
.site-header {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e8ddd8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: opacity 0.15s;
}

.logo-btn:hover { opacity: 0.75; }
.logo-btn img { height: 40px; width: auto; display: block; }

/* ── Hamburger ── */
.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-radius: 6px;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: #2d1515;
  border-radius: 2px;
  transition: background 0.15s;
}

.hamburger-btn:hover span { background: #168080; }

/* ── Fullskjerm-meny ── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: #f7ede7;
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.nav-overlay.hidden { display: none; }

.nav-overlay-inner {
  display: flex;
  flex-direction: column;
  padding: 24px 28px 48px;
  height: 100%;
}

.nav-close {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 24px;
  color: #2d1515;
  cursor: pointer;
  padding: 4px 8px;
  margin-bottom: 32px;
  line-height: 1;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.nav-link {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 36px;
  font-weight: 600;
  color: #2d1515;
  text-decoration: none;
  padding: 18px 0;
  border-bottom: 1px solid rgba(45,21,21,0.1);
  transition: color 0.15s;
}

.nav-link:first-child { border-top: 1px solid rgba(45,21,21,0.1); }
.nav-link:hover { color: #168080; }
.nav-link-active { color: #168080; }

.nav-cta {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 32px;
}

/* ── Tab-navigasjon ── */
.dash-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: #ede0d8;
  border-radius: 50px;
  padding: 4px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Source Sans Pro', sans-serif;
  cursor: pointer;
  background: transparent;
  color: #6a4a4a;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn.tab-active {
  background: #fff;
  color: #168080;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.tab-badge {
  background: #168080;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Container ── */
.container {
  width: 100%;
  max-width: 540px;
  padding: 48px 16px 80px;
}

/* ── Landing ── */
#view-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: #2d1515;
  text-align: center;
  margin-bottom: 12px;
}

.page-subtitle {
  font-size: 16px;
  color: #6a4a4a;
  text-align: center;
  margin-bottom: 36px;
  line-height: 1.6;
  max-width: 420px;
}

/* ── Card ── */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 36px 32px;
  box-shadow: 0 2px 16px rgba(45,21,21,0.06);
  margin-bottom: 16px;
  border: 1px solid #e8ddd8;
}

.card h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #2d1515;
}

.hint {
  color: #6a4a4a;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ── Form ── */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #2d1515;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #d4c0b8;
  border-radius: 8px;
  font-size: 16px;
  font-family: 'Source Sans Pro', sans-serif;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: #2d1515;
  background: #fff;
}

.field input:focus {
  border-color: #168080;
  box-shadow: 0 0 0 3px rgba(22,128,128,0.12);
}

.field-hint {
  font-size: 12px;
  color: #9a7a7a;
  margin-top: 5px;
  line-height: 1.4;
}

/* ── Samtykke ── */
.consent-wrap {
  margin-bottom: 20px;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.consent-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.consent-box {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid #d4c0b8;
  border-radius: 5px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: border-color 0.15s, background 0.15s;
}

.consent-box::after {
  content: '';
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0;
  transition: opacity 0.1s;
}

.consent-label input:checked ~ .consent-box {
  background: #168080;
  border-color: #168080;
}

.consent-label input:checked ~ .consent-box::after {
  opacity: 1;
}

.consent-text {
  font-size: 14px;
  color: #6a4a4a;
  line-height: 1.5;
}

.consent-link {
  color: #168080;
  text-decoration: underline;
}

/* ── Knapper ── */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: #168080;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Source Sans Pro', sans-serif;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 4px;
}

.btn-primary:hover  { background: #126868; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  width: 100%;
  max-width: 540px;
  padding: 14px;
  background: transparent;
  color: #168080;
  border: 2px solid #168080;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Source Sans Pro', sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-top: 12px;
}

.btn-secondary:hover { background: #f0f7f7; }

.btn-link {
  background: none;
  border: none;
  color: #168080;
  font-size: 14px;
  font-family: 'Source Sans Pro', sans-serif;
  cursor: pointer;
  margin-top: 16px;
  padding: 0;
  display: block;
  text-decoration: underline;
}

.already-account {
  margin-top: 20px;
  font-size: 15px;
  color: #6a4a4a;
}

.inline-link {
  background: none;
  border: none;
  color: #168080;
  font-size: 15px;
  font-family: 'Source Sans Pro', sans-serif;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.logout-btn { margin-top: 24px; }

/* ── Error ── */
.error {
  color: #c0392b;
  font-size: 14px;
  margin-top: 12px;
  background: #fdf2f2;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 10px 14px;
}

/* ── Loading ── */
.loading-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: #2d1515;
  margin-bottom: 8px;
  text-align: center;
}

.loading-sub {
  font-size: 14px;
  color: #6a4a4a;
  text-align: center;
}

/* ── Dashboard ── */
.welcome {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  color: #2d1515;
  margin-bottom: 24px;
}

.section-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: #2d1515;
  margin: 8px 0 12px;
}

/* ── Boligverdi-kort ── */
.property-card {
  background: linear-gradient(135deg, #168080 0%, #0f5f5f 100%);
  border: none;
  color: #fff;
}

.prop-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 8px;
}

.prop-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 12px;
}

.prop-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.prop-address {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
}

.prop-badge {
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
}

.prop-divider {
  height: 1px;
  background: rgba(255,255,255,0.2);
  margin: 20px 0;
}

.prop-cta-text {
  font-size: 15px;
  color: rgba(255,255,255,0.9);
  line-height: 1.5;
  margin-bottom: 16px;
}

.btn-cta {
  display: inline-block;
  padding: 13px 28px;
  background: #fff;
  color: #168080;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Source Sans Pro', sans-serif;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn-cta:hover  { background: #f0f7f7; }
.btn-cta:active { transform: scale(0.98); }

/* ── Søknadskort ── */
.application-card { margin-bottom: 12px; }

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 12px;
}

.app-type {
  font-size: 12px;
  font-weight: 700;
  color: #168080;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.app-amount {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: #2d1515;
}

.badge {
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Progress ── */
.progress-wrap { margin-bottom: 16px; }

.progress-bar {
  height: 6px;
  background: #e0d0c8;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.7s ease;
}

.progress-steps { display: flex; justify-content: space-between; }

.step { font-size: 11px; color: #9aaa9a; text-align: center; flex: 1; }
.step.done { color: #191a1a; font-weight: 700; }

.lost-note {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
  background: #fdf2f2;
  color: #c0392b;
  border-radius: 8px;
  padding: 12px 14px;
}

.app-date {
  font-size: 12px;
  color: #9a8080;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f4f0;
}

/* ── Spinner ── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e0eae0;
  border-top-color: #168080;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

#view-loading, #view-register-loading { text-align: center; color: #5a6a5a; }

/* ── Egenkapitalkalkulator ── */
.value-props {
  list-style: none;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.value-props li {
  font-size: 15px;
  color: #2d1515;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.vp-check {
  color: #168080;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.calc-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #2d1515;
}

.input-currency {
  position: relative;
  display: flex;
  align-items: center;
}

.input-currency input {
  padding-right: 40px;
}

.currency-suffix {
  position: absolute;
  right: 14px;
  font-size: 15px;
  color: #6a4a4a;
  font-weight: 600;
  pointer-events: none;
}

/* Bar */
.equity-bar-wrap { margin-top: 4px; }

.equity-bar {
  display: flex;
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
  background: #e8ddd8;
  margin-bottom: 10px;
}

.bar-segment { transition: width 0.5s ease; height: 100%; }
.bar-mortgage  { background: #1a3a3a; }
.bar-available { background: #168080; }
.bar-buffer    { background: #e8edea; }

.bar-legend {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #6a4a4a;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 4px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}

.dot-mortgage  { background: #1a3a3a; }
.dot-available { background: #168080; }
.dot-buffer    { background: #d0dbd0; }

/* Nøkkeltall */
.equity-numbers {
  background: #f5ece6;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 8px;
}

.equity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.equity-label { font-size: 14px; color: #5a6a5a; }
.equity-value { font-size: 15px; font-weight: 700; color: #191a1a; }

.equity-divider {
  height: 1px;
  background: #d8c8c0;
  margin: 8px 0;
}

.equity-row-highlight .equity-label {
  font-weight: 700;
  color: #2d1515;
  font-size: 15px;
}

.equity-value-big {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  color: #168080;
}

/* Resultat */
.equity-result {
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 4px;
}

.result-ok {
  background: #eaf5f0;
  border: 1px solid #a0d0b8;
  color: #0f4a3a;
}

.result-partial {
  background: #fdf6ed;
  border: 1px solid #f0d090;
  color: #7a4a00;
}

.offer-success {
  background: #eaf5f0;
  border: 1px solid #a0d0b8;
  border-radius: 10px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.6;
  color: #0f4a3a;
  margin-top: 12px;
  text-align: center;
}

.equity-overloan {
  background: #fdf2f2;
  border: 1px solid #f5c6cb;
  border-radius: 10px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #7a1a1a;
  margin-top: 8px;
}

/* ── Footer ── */
.site-footer {
  margin-top: auto;
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: #9a8080;
}

.rate-example {
  font-size: 11px;
  color: #b09090;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Mobil ── */
@media (max-width: 480px) {
  .card { padding: 24px 20px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .prop-value { font-size: 34px; }
  .app-amount { font-size: 20px; }
  .step { font-size: 10px; }
  .container { padding-top: 32px; }
}
