/* ═══════════════════════════════════════════════
   SOLAR SMART ADVISOR — APP STYLES
   app.css
   Step-specific layouts and welcome screen.
   Imports all other CSS modules.
═══════════════════════════════════════════════ */

/* ── Welcome Screen ──────────────────────── */
#step-welcome {
  background: var(--color-bg);
  /* "safe center" — plain `center` clips the top of the hero (logo +
     heritage line) when content grows taller than one viewport, because
     overflowing centered flex content isn't reachable by scroll. `safe`
     falls back to start-alignment once content overflows, so nothing
     above the fold gets clipped. */
  justify-content: safe center;
  align-items: center;
  text-align: center;
  padding: var(--space-10) var(--space-6);
  padding-bottom: calc(var(--space-10) + var(--brand-footer-height));
  gap: 0;
  position: relative;
  overflow-y: auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.welcome-bg-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(242,182,50,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(242,182,50,0.05) 0%, transparent 60%);
  pointer-events: none;
}

.welcome-grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.welcome-logo-wrap {
  position: relative;
  flex-shrink: 0;
  margin-bottom: var(--space-12);
  z-index: 1;
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  direction: ltr;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(242, 182, 50, 0.25));
}

.brand-text { text-align: start; }

.brand-wordmark {
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  letter-spacing: 1px;
  color: var(--color-text);
  line-height: 1;
}

.brand-tagline {
  font-size: 9px;
  font-weight: var(--weight-semibold);
  letter-spacing: 1.5px;
  color: var(--color-text-dim);
  margin-top: 3px;
  white-space: nowrap;
}

/* Heritage/legal-name line — deliberately smaller than both the
   wordmark and the tagline above it, so it reads as a trust footnote,
   never competing with the main ANDORIA brand. */
.brand-heritage {
  font-size: 8px;
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  margin-top: 2px;
  white-space: nowrap;
}
.brand-heritage:empty { display: none; }

/* On the welcome hero specifically, the heritage line should read clearly
   (still secondary to ANDORIA, but no longer a footnote) — this id only
   targets the welcome hero instance, so the shared .brand-heritage class
   above stays untouched for any future reuse elsewhere. */
#welcome-brand-heritage {
  font-size: 11px;
  font-weight: var(--weight-bold);
  color: var(--color-text-bone, var(--color-text));
  letter-spacing: 0.2px;
  margin-top: 4px;
}

.welcome-eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-gold);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
  z-index: 1;
  position: relative;
}

.welcome-h1 {
  font-size: clamp(26px, 7vw, 46px);
  font-weight: var(--weight-black);
  line-height: 1.2;
  margin-bottom: var(--space-5);
  z-index: 1;
  position: relative;
}

.welcome-subtitle {
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
  max-width: 340px;
  margin: 0 auto var(--space-12);
  z-index: 1;
  position: relative;
}

.welcome-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  max-width: 360px;
  margin: 0 auto var(--space-12);
  z-index: 1;
  position: relative;
  width: 100%;
}

.welcome-stat-card {
  background: linear-gradient(160deg, var(--color-surface), rgba(212,168,67,0.05));
  border: 1px solid var(--color-border-gold);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-2);
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.welcome-stat-val { font-size: 22px; font-weight: var(--weight-black); color: var(--color-gold); line-height: 1; margin-bottom: 4px; }
.welcome-stat-lbl { font-size: 11px; color: var(--color-text-muted); font-weight: var(--weight-medium); }

/* Honest "ready to calculate" trust indicator — NOT a fake user/activity
   counter. See constants.js DEMO_ACTIVITY_* for why no number lives here. */
.trust-ready-badge {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-3) var(--space-5);
  max-width: 360px;
  margin: 0 auto var(--space-8);
  z-index: 1;
  position: relative;
  width: 100%;
}
.trust-ready-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 0 rgba(76, 217, 100, 0.5);
  flex-shrink: 0;
  animation: trustPulse 2s infinite;
}
@keyframes trustPulse {
  0%   { box-shadow: 0 0 0 0 rgba(76, 217, 100, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(76, 217, 100, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 217, 100, 0); }
}
.trust-ready-title { font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--color-text-bone); text-align: start; }
.trust-ready-sub   { font-size: 10px; color: var(--color-text-muted); text-align: start; }

.welcome-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  z-index: 1;
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

/* ── Step Header Variants ─────────────────── */
.step-title    { font-size: var(--text-2xl); font-weight: var(--weight-extrabold); line-height: var(--leading-tight); margin-bottom: var(--space-2); transition: font-size var(--duration-normal) var(--ease-out); }
.step-subtitle { font-size: var(--text-sm); color: var(--color-text-muted); line-height: var(--leading-normal); }

/* Scroll-collapsing step header (mobile screen-space reclaim) — once the
   customer starts scrolling a step's product/card list, the eyebrow +
   subtitle fade/collapse away and the title shrinks, freeing real
   vertical room for the cards themselves. The compact top nav bar
   (#progress-bar, outside .step-shell) is untouched and stays visible
   throughout, so step context is never fully lost. Toggled by a
   lightweight scroll listener in app.js — see initStepHeaderCollapse(). */
.step-header {
  transition: padding var(--duration-normal) var(--ease-out);
}
.step-header .eyebrow {
  transition: opacity var(--duration-normal) var(--ease-out),
              max-height var(--duration-normal) var(--ease-out),
              margin var(--duration-normal) var(--ease-out);
  max-height: 40px;
  overflow: hidden;
}
.step-header .step-subtitle {
  transition: opacity var(--duration-normal) var(--ease-out),
              max-height var(--duration-normal) var(--ease-out),
              margin var(--duration-normal) var(--ease-out);
  max-height: 80px;
  overflow: hidden;
}
.step-shell.scrolled .step-header {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}
.step-shell.scrolled .step-header .eyebrow {
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
}
.step-shell.scrolled .step-header .step-subtitle {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
}
.step-shell.scrolled .step-header .step-title {
  font-size: var(--text-lg);
  margin-bottom: 0;
}

/* ── Arc SVG Wrapper ─────────────────────── */
.arc-wrapper {
  display: flex;
  justify-content: center;
  padding: var(--space-5) 0 var(--space-2);
}

/* ── Empty Device State ──────────────────── */
.device-empty {
  text-align: center;
  padding: var(--space-8) var(--space-6);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.device-empty-icon { font-size: 40px; margin-bottom: var(--space-4); }

/* ── Restart Link ────────────────────────── */
.restart-link {
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-family: var(--font-primary);
  font-weight: var(--weight-semibold);
  border: none;
  cursor: pointer;
  padding: var(--space-2) var(--space-4);
  transition: color var(--duration-fast);
  display: block;
  margin: 0 auto;
}
.restart-link:hover { color: var(--color-text); }

/* ── Motor Load Warning ──────────────────── */
.motor-warning {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-warning);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-4);
  display: none;
}

/* ── Payment (step 12) ────────────────────── */
.payment-methods-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.payment-badge {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-bone);
}
.payment-security-note {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}
.payment-placeholder-card {
  background: var(--color-surface);
  border: 1px dashed var(--color-border-gold);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-6);
  text-align: center;
  margin-bottom: var(--space-6);
}
.payment-placeholder-icon { font-size: 32px; margin-bottom: var(--space-3); }
.payment-placeholder-title { font-size: var(--text-base); font-weight: var(--weight-extrabold); color: var(--color-text); margin-bottom: var(--space-2); }
.payment-placeholder-desc  { font-size: var(--text-sm); color: var(--color-text-muted); line-height: var(--leading-normal); }

/* ── Order Review buyer/recipient rows (step 11) ─────────────── */
.review-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-bone);
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.review-row:last-child { border-bottom: none; }
.review-row span { color: var(--color-text-muted); }

/* ── PDF Report ───────────────────────────────────────────────
   Off-screen by default; only shown (via @media print in
   responsive.css) when the user prints/saves the assessment as PDF.
   White background is intentional — a printed report should read as
   a document, not a dark-mode screen capture. ── */
.pdf-report {
  display: none;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-8);
  background: #FFFFFF;
  color: #14231B;
  font-family: var(--font-primary);
  /* No hardcoded direction — buildPDFReport() sets dir="rtl|ltr" on this
     element directly to match whichever language generated the report. */
}

.pdf-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  border-bottom: 3px solid var(--color-gold);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-6);
}
.pdf-logo { width: 44px; height: 44px; flex-shrink: 0; }
.pdf-brand { direction: ltr; text-align: start; }
.pdf-brand-name { font-size: 20px; font-weight: var(--weight-black); letter-spacing: 1px; color: #14231B; line-height: 1; }
.pdf-brand-tagline { font-size: 9px; font-weight: var(--weight-semibold); letter-spacing: 1px; color: #6B7A70; margin-top: 2px; }
.pdf-report-title { margin-inline-start: auto; font-size: var(--text-lg); font-weight: var(--weight-extrabold); color: #14231B; }

.pdf-section { margin-bottom: var(--space-6); }
.pdf-section-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: #071A12;
  background: rgba(242, 182, 50, 0.12);
  border-inline-start: 3px solid var(--color-gold);
  padding: 6px var(--space-3);
  margin-bottom: var(--space-3);
}

.pdf-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3) var(--space-5); }
.pdf-grid > div { display: flex; flex-direction: column; gap: 2px; padding-bottom: var(--space-2); border-bottom: 1px solid #E5E5E0; }
.pdf-grid span { font-size: 11px; color: #6B7A70; font-weight: var(--weight-medium); }
.pdf-grid strong { font-size: var(--text-sm); color: #14231B; font-weight: var(--weight-bold); }

.pdf-list { display: flex; flex-direction: column; gap: var(--space-2); }
.pdf-list-row {
  display: flex; justify-content: space-between; gap: var(--space-4);
  padding: 8px 0; border-bottom: 1px solid #E5E5E0; font-size: var(--text-sm);
}
.pdf-list-row b { color: var(--color-gold); }

.pdf-badges {
  display: flex; justify-content: space-around; text-align: center;
  background: rgba(242, 182, 50, 0.08);
  border: 1px solid rgba(242, 182, 50, 0.3);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: #14231B;
}

.pdf-footer {
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid #E5E5E0;
  text-align: center;
}
.pdf-footer-logo { display: flex; justify-content: center; margin-bottom: var(--space-2); }
.pdf-footer-company { font-size: var(--text-sm); font-weight: var(--weight-bold); color: #14231B; margin-bottom: 4px; }
#pdf-contact  { font-size: var(--text-xs); color: #6B7A70; }
#pdf-whatsapp {
  display: block;
  font-size: var(--text-xs);
  color: #B8860B;
  text-decoration: underline;
  margin-bottom: var(--space-4);
}
.pdf-powered { font-size: 10px; color: #9AA59D; letter-spacing: 0.5px; }
.motor-warning.visible { display: block; }
