/* ========================================
   Amazing Hair Priskalkylator – Styles
   ======================================== */

:root {
  --bg-light: #F5EFE2;
  --bg-dark: #EDE3CE;
  --card-bg: #FBF7EC;
  --text-dark: #2A2118;
  --text-mid: #3D3024;
  --text-soft: #5A4A36;
  --text-mute: #7A6B54;
  --text-faint: #9C8E76;
  --accent: #8B6F47;
  --accent-light: #C4A581;
  --accent-mid: #A8896B;
  --accent-deep: #6F5836;
  --border: rgba(139, 111, 71, 0.15);
  --border-mid: rgba(139, 111, 71, 0.2);
  --highlight: #F0E6D2;
  --tip-bg: #FFF8E6;
  --tip-border: #E8D896;
  --tip-text: #5A4520;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-dark);
  background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-dark) 100%);
  min-height: 100vh;
}

/* ===== LÖSENORDS-SKÄRM ===== */
.login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #2A2118 0%, #3D3024 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.login-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 48px 36px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--text-dark);
  color: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 1px;
  margin: 0 auto 20px;
}

.login-title {
  font-family: "Fraunces", serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
  color: var(--text-dark);
}

.login-sub {
  font-size: 13px;
  color: var(--text-mute);
  margin: 0 0 32px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.login-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 2px;
}

.login-input {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-mid);
  background: white;
  font-family: "Inter Tight", sans-serif;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}
.login-input:focus { border-color: var(--accent); }

.login-btn {
  margin-top: 8px;
  padding: 14px 20px;
  border-radius: 10px;
  border: none;
  background: var(--text-dark);
  color: var(--bg-light);
  font-family: "Inter Tight", sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.login-btn:hover { background: var(--text-mid); }

.login-error {
  font-size: 13px;
  color: #B83A2B;
  text-align: center;
  margin-top: 4px;
  min-height: 18px;
}

/* ===== HUVUDAPP ===== */
.container {
  padding: 40px 24px;
  max-width: 880px;
  margin: 0 auto;
}

.header { margin-bottom: 40px; }

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--text-dark);
  color: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.brand-name {
  font-family: "Fraunces", serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.5px;
  line-height: 1;
}

.brand-sub {
  font-size: 13px;
  color: var(--text-mute);
  margin-top: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.logout-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text-mute);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-family: "Inter Tight", sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.logout-btn:hover { background: rgba(139, 111, 71, 0.08); color: var(--text-dark); }

.tagline {
  font-family: "Fraunces", serif;
  font-size: 22px;
  font-weight: 300;
  font-style: italic;
  line-height: 1.4;
  color: var(--text-mid);
  max-width: 600px;
}

/* ===== STEGINDIKATOR ===== */
.stepper {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.stepper-item {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-faint);
  transition: all 0.2s ease;
  font-size: 14px;
  user-select: none;
}

.stepper-item.active {
  background: var(--text-dark);
  color: var(--bg-light);
}

.stepper-item.done { color: var(--accent); }

.stepper-number {
  font-family: "Fraunces", serif;
  font-size: 16px;
  font-weight: 500;
}

.stepper-label { font-weight: 500; }

/* ===== KORT ===== */
.card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 36px 32px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(42, 33, 24, 0.06);
}

.step-title {
  font-family: "Fraunces", serif;
  font-size: 36px;
  font-weight: 500;
  margin: 0 0 8px;
  letter-spacing: -1px;
}

.step-intro {
  font-size: 15px;
  color: var(--text-soft);
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ===== INPUTS ===== */
.input-row { margin-bottom: 22px; }

.input-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 12px;
}

.input-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
}

.help {
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
  text-align: right;
}

.input-wrap {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border-mid);
  padding: 4px 14px;
  margin-bottom: 8px;
}

.input-wrap input[type="number"] {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: "Inter Tight", sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-dark);
  padding: 10px 0;
  width: 100%;
  -moz-appearance: textfield;
}

.input-wrap input[type="number"]::-webkit-outer-spin-button,
.input-wrap input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.suffix {
  font-size: 13px;
  color: var(--text-faint);
  font-weight: 500;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

/* ===== MINIRESULTAT ===== */
.mini-result {
  margin-top: 28px;
  padding: 20px 22px;
  background: rgba(139, 111, 71, 0.06);
  border-radius: 12px;
  border: 1px solid rgba(139, 111, 71, 0.12);
}

.mini-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-soft);
  gap: 12px;
}

.mini-row-total {
  border-top: 1px solid var(--border-mid);
  margin-top: 6px;
  padding-top: 12px;
  font-size: 15px;
  color: var(--text-dark);
}

/* ===== TOGGLE & TIPBOX ===== */
.toggle-row { margin-bottom: 20px; }

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-soft);
  cursor: pointer;
}

.checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.tip-box {
  background: var(--tip-bg);
  border: 1px solid var(--tip-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--tip-text);
}

/* ===== STORT RESULTAT ===== */
.big-result {
  text-align: center;
  padding: 32px 24px;
  background: linear-gradient(135deg, #2A2118 0%, #3D3024 100%);
  border-radius: 16px;
  color: var(--bg-light);
  margin-bottom: 28px;
}

.big-result-label {
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 12px;
}

.big-result-value {
  font-family: "Fraunces", serif;
  font-size: 72px;
  font-weight: 500;
  letter-spacing: -2px;
  line-height: 1;
}

.big-result-unit {
  font-size: 24px;
  font-weight: 300;
  color: var(--accent-light);
  font-style: italic;
}

.big-result-sub {
  font-size: 13px;
  color: var(--accent-mid);
  margin-top: 14px;
  font-style: italic;
}

/* ===== KPI ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.kpi {
  background: white;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.kpi-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.kpi-value {
  font-family: "Fraunces", serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--text-dark);
}

/* ===== DIAGRAM ===== */
.chart-block {
  margin-bottom: 28px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  border: 1px solid rgba(139, 111, 71, 0.12);
}

.chart-title {
  font-family: "Fraunces", serif;
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 16px;
  color: var(--text-dark);
}

/* Donut */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

#donut-chart {
  flex-shrink: 0;
}

.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-soft);
}

.donut-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.donut-legend-value {
  margin-left: auto;
  font-weight: 500;
  color: var(--text-dark);
}

/* Bar */
.bar-wrap { padding: 8px 0; }

.bar-row {
  display: flex;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #F0E6D2;
}

.bar-fill {
  height: 100%;
  transition: width 0.4s ease;
}

.bar-lon { background: var(--accent); }
.bar-kost { background: var(--accent-light); }

.bar-legend {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-soft);
}

.bar-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.swatch-lon { background: var(--accent); }
.swatch-kost { background: var(--accent-light); }

/* ===== INSIKT ===== */
.insight-box {
  background: var(--highlight);
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid var(--border-mid);
}

.insight-title {
  font-family: "Fraunces", serif;
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 10px;
}

.insight-list {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-mid);
}

/* ===== NAVIGATION ===== */
.nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.btn {
  padding: 14px 24px;
  border-radius: 10px;
  border: none;
  font-family: "Inter Tight", sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--text-dark);
  color: var(--bg-light);
}
.btn-primary:hover { background: var(--text-mid); }

.btn-secondary {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border-mid);
}
.btn-secondary:hover { background: rgba(139, 111, 71, 0.08); }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.footer {
  text-align: center;
  margin-top: 30px;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.5px;
}

/* ===== RESPONSIVT ===== */
@media (max-width: 640px) {
  .container { padding: 24px 16px; }
  .header { margin-bottom: 28px; }
  .brand-row { flex-wrap: wrap; }
  .logout-btn { margin-left: auto; }
  .tagline { font-size: 18px; }
  .card { padding: 24px 20px; }
  .step-title { font-size: 28px; }
  .big-result-value { font-size: 56px; }
  .stepper { flex-wrap: wrap; gap: 4px; }
  .stepper-item { padding: 8px 10px; font-size: 12px; }
  .stepper-label { display: none; }
  .stepper-item.active .stepper-label { display: inline; }
  .kpi-grid { grid-template-columns: 1fr; }
  .donut-wrap { flex-direction: column; align-items: center; }
  .donut-legend { width: 100%; }
  .nav { flex-direction: column-reverse; }
  .btn { width: 100%; }
}
