/* ============================================================
   Mr. M — Stylesheet
   Specialists in preloved Miele appliances
   ============================================================ */

:root {
  --black:   #0a0a0a;
  --off-black:#111;
  --charcoal:#1c1c1c;
  --mid:     #2e2e2e;
  --muted:   #888;
  --light:   #f5f3ef;
  --cream:   #faf8f4;
  --white:   #ffffff;
  --accent:  #c8a96e;
  --accent2: #e85d3a;
  --radius:  6px;
  --header-h:64px;
  font-size: 16px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--off-black);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── TYPOGRAPHY ── */
h1, h2, h3 { font-family: 'Cormorant Garamond', serif; line-height: 1.15; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 400; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 400; }
h3 { font-size: 1.3rem; font-weight: 600; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.5rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .03em;
  transition: all .2s;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary  { background: var(--off-black); color: var(--white); border-color: var(--off-black); }
.btn-primary:hover { background: var(--charcoal); }
.btn-outline  { background: transparent; color: var(--off-black); border-color: var(--off-black); }
.btn-outline:hover { background: var(--off-black); color: var(--white); }
.btn-accent   { background: var(--accent2); color: var(--white); border-color: var(--accent2); }
.btn-accent:hover { background: #d44e2e; }
.btn-ghost    { background: transparent; color: var(--off-black); padding: .5rem .8rem; font-size: .875rem; font-weight: 500; }
.btn-ghost:hover { color: var(--muted); }
.btn-sm       { padding: .5rem 1rem; font-size: .8125rem; }
.btn-full     { width: 100%; justify-content: center; }
.link-btn     { color: var(--accent); text-decoration: underline; background: none; border: none; cursor: pointer; font-size: inherit; }
.hidden       { display: none !important; }

/* ── HEADER ── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  background: transparent;
  transition: background .3s, box-shadow .3s;
}
.site-header.scrolled {
  background: rgba(250, 248, 244, .96);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.logo { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; font-weight: 600; letter-spacing: .04em; }
.site-nav { display: flex; gap: 1.75rem; align-items: center; }
.site-nav a { font-size: .875rem; font-weight: 500; color: var(--off-black); transition: color .2s; }
.site-nav a:hover { color: var(--muted); }
.nav-cta { background: var(--off-black); color: var(--white) !important; padding: .45rem 1.1rem; border-radius: var(--radius); }
.nav-cta:hover { background: var(--charcoal) !important; color: var(--white) !important; }
.header-auth { display: flex; align-items: center; gap: .5rem; }
.nav-hamburger { display: none; flex-direction: column; gap: 5px; padding: .5rem; }
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--off-black); border-radius: 2px; transition: .2s; }

/* ── MOBILE NAV ── */
.mobile-nav {
  position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
  background: var(--white); z-index: 200; padding: 5rem 2rem 2rem;
  display: flex; flex-direction: column; gap: 1rem;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 24px rgba(0,0,0,.1);
}
.mobile-nav.open { right: 0; }
.mobile-nav-close { position: absolute; top: 1.2rem; right: 1.2rem; font-size: 1.2rem; }
.mobile-nav-link { display: block; padding: .75rem 0; font-size: 1.1rem; font-family: 'Cormorant Garamond', serif; border-bottom: 1px solid #eee; }
.mobile-nav-auth { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 150; display: none; }
.overlay.open { display: block; }

/* ── MODALS ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 300; display: none; align-items: center; justify-content: center;
  padding: 1rem; backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--white); border-radius: 12px;
  padding: 2rem; width: 100%; max-height: 90vh; overflow-y: auto;
  position: relative; animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity:0; transform: scale(.96) translateY(8px); } to { opacity:1; transform: none; } }
.modal-close { position: absolute; top: 1rem; right: 1rem; font-size: 1.1rem; color: var(--muted); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background .2s; }
.modal-close:hover { background: #f0f0f0; }
.modal-title { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; margin-bottom: .25rem; }
.modal-sub { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.auth-modal-box, .terms-modal-box { max-width: 420px; }
.dashboard-modal-box, .tradein-modal-box { max-width: 560px; }

/* ── AUTH ── */
.auth-tabs { display: flex; border-bottom: 2px solid #eee; margin-bottom: 1.5rem; }
.auth-tab { flex: 1; padding: .6rem; text-align: center; font-size: .875rem; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: .2s; }
.auth-tab.active { color: var(--off-black); border-bottom-color: var(--off-black); }
.auth-notice { background: #fff8ec; border: 1px solid #f0dca0; border-radius: var(--radius); padding: .75rem 1rem; font-size: .82rem; line-height: 1.5; margin-bottom: 1.2rem; color: #6b5200; }
.auth-error { color: var(--accent2); font-size: .82rem; min-height: 1.2rem; margin-bottom: .5rem; }
.auth-switch { font-size: .82rem; color: var(--muted); margin-top: .75rem; text-align: center; }

/* ── FORMS ── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .82rem; font-weight: 500; margin-bottom: .4rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: .65rem .85rem; border: 1px solid #ddd; border-radius: var(--radius);
  font-size: .9rem; font-family: inherit; transition: border .2s;
  background: var(--white); color: var(--off-black);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--off-black); }
.form-group input:disabled { background: #f5f5f5; color: var(--muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.field-hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; font-size: .85rem; cursor: pointer; }

/* ── DASHBOARD ── */
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.dash-sub { color: var(--muted); font-size: .85rem; }
.dash-tabs { display: flex; border-bottom: 2px solid #eee; margin-bottom: 1.5rem; }
.dash-tab { flex: 1; padding: .6rem; text-align: center; font-size: .875rem; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: .2s; }
.dash-tab.active { color: var(--off-black); border-bottom-color: var(--off-black); }
.dash-empty { color: var(--muted); font-size: .9rem; padding: 2rem 0; }
.quote-card { border: 1px solid #eee; border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.quote-type { font-weight: 600; flex: 1; }
.quote-meta { color: var(--muted); font-size: .82rem; }
.quote-date { font-size: .78rem; color: var(--muted); margin-left: auto; }
.status-pending { background: #fff8ec; color: #b37400; font-size: .75rem; padding: .2rem .6rem; border-radius: 20px; font-weight: 500; }
.status-reviewed { background: #edf7ed; color: #2e7d32; font-size: .75rem; padding: .2rem .6rem; border-radius: 20px; font-weight: 500; }
.profile-saved { color: #2e7d32; font-size: .85rem; margin-top: .5rem; }

/* ── TRADE-IN ── */
.tradein-steps { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
.tradein-step { flex: 1; text-align: center; padding: .4rem; font-size: .78rem; font-weight: 500; color: var(--muted); border-bottom: 2px solid #eee; }
.tradein-step.active { color: var(--off-black); border-bottom-color: var(--off-black); }
.tradein-step.done { color: var(--accent); border-bottom-color: var(--accent); }
.condition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.condition-opt, .radio-opt { display: flex; align-items: center; gap: .4rem; padding: .5rem .7rem; border: 1px solid #ddd; border-radius: var(--radius); cursor: pointer; font-size: .85rem; transition: .15s; }
.condition-opt:hover, .radio-opt:hover { border-color: var(--off-black); }
.radio-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.tradein-btn-row { display: flex; gap: .75rem; justify-content: flex-end; }
.tradein-note { font-size: .78rem; color: var(--muted); text-align: center; margin-top: .75rem; }
.success-icon { font-size: 2.5rem; text-align: center; margin-bottom: .75rem; }
.success-title { text-align: center; margin-bottom: .5rem; }
.success-msg { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }

/* ── TERMS ── */
.terms-body { font-size: .9rem; line-height: 1.7; margin-bottom: 1.5rem; }
.terms-body ol { padding-left: 1.2rem; }
.terms-body li { margin-bottom: .5rem; }

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  background: var(--black);
  color: var(--white);
  padding: calc(var(--header-h) + 4rem) 2rem 4rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(200,169,110,.12) 0%, transparent 60%);
}
.hero-content { max-width: 680px; position: relative; z-index: 1; }
.hero-kicker { font-size: .8rem; letter-spacing: .15em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.hero-title { color: var(--white); margin-bottom: 1.25rem; }
.hero-sub { font-size: 1.05rem; color: rgba(255,255,255,.7); margin-bottom: 2rem; max-width: 520px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-actions .btn-outline { border-color: rgba(255,255,255,.4); color: var(--white); }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,.1); border-color: var(--white); }
.hero-scroll { position: absolute; bottom: 2rem; left: 2rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; color: rgba(255,255,255,.4); font-size: .7rem; letter-spacing: .1em; }
.scroll-line { width: 1px; height: 40px; background: rgba(255,255,255,.2); }

/* ── SELL BANNER ── */
.sell-banner {
  background: var(--charcoal); color: var(--white);
  padding: 1rem 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.sell-banner p { font-size: .9rem; }

/* ── SECTIONS ── */
.section { padding: 5rem 2rem; }
.container { max-width: 900px; margin: 0 auto; }
.section-kicker { font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; color: var(--accent); margin-bottom: .75rem; }
.section-title { margin-bottom: 2rem; }

/* ── STORY ── */
.section-story { background: var(--cream); }
.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-bottom: 2rem; }
.story-block p { font-size: 1.05rem; line-height: 1.75; color: #333; }
.story-tagline { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; font-style: italic; color: var(--muted); border-left: 3px solid var(--accent); padding-left: 1.25rem; }

/* ── TIMELINE ── */
.section-timeline { background: var(--white); }
.timeline-intro { color: var(--muted); margin-bottom: 3rem; }
.timeline { list-style: none; position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: #e0e0e0; }
.timeline-item { position: relative; padding-bottom: 2.5rem; }
.timeline-item::before { content: ''; position: absolute; left: -2rem; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: translateX(-.5px); }
.timeline-year { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: .35rem; }
.timeline-title { margin-bottom: .4rem; font-size: 1.15rem; }
.timeline-desc { color: #555; font-size: .95rem; }

/* ── WHY PRELOVED ── */
.section-why { background: var(--black); color: var(--white); }
.section-why .section-title { color: var(--white); }
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-top: 2rem; }
.why-card { background: var(--charcoal); border-radius: 8px; padding: 1.75rem; }
.why-icon { font-size: 1.5rem; margin-bottom: .75rem; }
.why-card h3 { font-size: 1.1rem; margin-bottom: .5rem; color: var(--white); }
.why-card p { font-size: .9rem; color: rgba(255,255,255,.6); line-height: 1.6; }

/* ── PHILOSOPHY ── */
.section-philosophy { background: var(--light); }
.philosophy-body { font-size: 1.05rem; line-height: 1.8; color: #333; margin-bottom: 1.25rem; max-width: 700px; }
.section-philosophy .btn { margin-top: .75rem; }

/* ── FOOTER ── */
.site-footer { background: var(--off-black); color: rgba(255,255,255,.7); padding: 3rem 2rem; }
.footer-inner { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }
.footer-logo { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; color: var(--white); display: block; margin-bottom: .4rem; }
.footer-tagline { font-size: .85rem; line-height: 1.5; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.footer-nav a { font-size: .85rem; transition: color .2s; }
.footer-nav a:hover { color: var(--white); }
.footer-legal { font-size: .78rem; color: rgba(255,255,255,.4); border-top: 1px solid rgba(255,255,255,.08); padding-top: 1.5rem; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .site-nav, .header-auth { display: none; }
  .nav-hamburger { display: flex; }
  .story-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .why-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding-top: calc(var(--header-h) + 2rem); }
  .tradein-steps { display: none; }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .sell-banner { flex-direction: column; text-align: center; }
  .condition-grid { grid-template-columns: 1fr; }
  .modal { padding: 1.5rem; }
  .tradein-btn-row { flex-direction: column; }
}

/* ── HEADER WHITE STATE (over dark hero) ── */
.site-header:not(.scrolled) .logo,
.site-header:not(.scrolled) .site-nav a,
.site-header:not(.scrolled) .btn-ghost {
  color: var(--white);
}
.site-header:not(.scrolled) .nav-cta {
  background: var(--white);
  color: var(--off-black) !important;
  border-color: var(--white);
}
.site-header:not(.scrolled) .nav-cta:hover {
  background: rgba(255,255,255,.85) !important;
}
.site-header:not(.scrolled) .btn-primary {
  background: var(--white);
  color: var(--off-black);
  border-color: var(--white);
}
.site-header:not(.scrolled) .nav-hamburger span {
  background: var(--white);
}

/* ══════════════════════════════════════
   HERO NAV FIX — white on dark hero
══════════════════════════════════════ */
.site-header:not(.scrolled) .logo,
.site-header:not(.scrolled) .site-nav a,
.site-header:not(.scrolled) .btn-ghost {
  color: rgba(255, 255, 255, 0.9);
}
.site-header:not(.scrolled) .site-nav a:hover {
  color: rgba(255, 255, 255, 0.6);
}
.site-header:not(.scrolled) .nav-cta {
  background: rgba(255, 255, 255, 0.15) !important;
  color: var(--white) !important;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.site-header:not(.scrolled) .nav-cta:hover {
  background: rgba(255, 255, 255, 0.28) !important;
}
.site-header:not(.scrolled) .btn-primary.btn-sm {
  background: var(--white);
  color: var(--off-black);
  border-color: var(--white);
}
.site-header:not(.scrolled) .nav-hamburger span {
  background: var(--white);
}

/* ══════════════════════════════════════
   TIMELINE IMAGES — full width, styled
══════════════════════════════════════ */
.timeline-image {
  margin-top: 1.1rem;
  border-radius: 8px;
  overflow: hidden;
  max-width: 540px;
}
.timeline-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  transition: transform 0.4s ease;
}
.timeline-image img:hover {
  transform: scale(1.02);
}
.timeline-image-caption {
  font-size: .75rem;
  color: var(--muted);
  margin-top: .45rem;
  line-height: 1.4;
}
.timeline-image-caption a {
  color: var(--muted);
  text-decoration: underline;
}
.timeline-image-placeholder {
  background: #f0ede8;
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  max-width: 540px;
  color: var(--muted);
  font-size: .85rem;
}
.timeline-image-placeholder span {
  display: block;
  font-size: 1.4rem;
  margin-bottom: .5rem;
}
.img-error { display: none !important; }

/* ══════════════════════════════════════
   LAYOUT REFINEMENTS
══════════════════════════════════════ */
.section-timeline {
  background: var(--white);
}
.timeline {
  padding-left: 2.5rem;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-content {
  padding-bottom: 0.5rem;
}
/* Larger timeline dots */
.timeline-item::before {
  width: 12px;
  height: 12px;
  left: -2.5rem;
  top: 0.3rem;
  box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.2);
}
