/*
 * SAE Solar & Battery Calculator — frontend styles
 *
 * Brand font is Omnes (fonts.adobe.com/fonts/omnes), a paid Adobe Fonts
 * typeface — Bold/Black weight for headings, Regular for copy. It can't be
 * loaded from a plain @import the way Google Fonts can; it needs either an
 * Adobe Fonts ("Typekit") kit embed or self-hosted @font-face files.
 *
 * Manrope is loaded below as a free stand-in with a similar weight
 * contrast so this looks right out of the box. TO GO LIVE WITH THE REAL
 * TYPEFACE: replace the @import line with SAE's Adobe Fonts kit <link>
 * (add it in class-sae-frontend.php's register_assets(), or paste the kit
 * <link> into your theme's header), then change --sae-font below to
 * "'Omnes', sans-serif".
 *
 * Colours and the two size variables (--sae-heading-size, --sae-body-size)
 * are set inline on .sae-calc-root from SAE Calculator → Design in
 * wp-admin (see class-sae-frontend.php) — the values below are just
 * fallbacks if that's ever missing. Every font-size in this file is a
 * calc() off one of those two variables, so changing either in Design
 * rescales the whole calculator proportionally.
 */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&display=swap');

.sae-calc-root {
  --sae-navy: #0C4E96;
  --sae-blue: #00AEEF;
  --sae-gold: #FCF352;
  --sae-mist: #F2F2F2;
  --sae-line: #E3E3E3;
  --sae-ink: #111827;
  --sae-muted: #64748B;
  --sae-font: 'Manrope', sans-serif; /* swap for 'Omnes', sans-serif once licensed */
  --sae-heading-size: 32px; /* base for large headline moments */
  --sae-body-size: 14px;    /* base for everything else */

  font-family: var(--sae-font);
  color: var(--sae-ink);
  max-width: 560px;
  margin: 0 auto;
  box-sizing: border-box;
}
.sae-calc-root * { box-sizing: border-box; }

.sae-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sae-header img { height: 34px; object-fit: contain; }
.sae-header .sae-phone { font-weight: 800; font-size: calc(var(--sae-body-size) * 0.93); color: var(--sae-navy); text-decoration: none; }
.sae-tagline { font-size: calc(var(--sae-body-size) * 0.82); color: var(--sae-muted); margin-bottom: 18px; }

.sae-card { background: #fff; border: 1.5px solid var(--sae-line); border-radius: 16px; padding: 16px; }

.sae-section-title { font-weight: 700; font-size: calc(var(--sae-body-size) * 0.96); color: var(--sae-navy); margin-bottom: 10px; }

.sae-entry-option { width: 100%; text-align: left; border: 1.5px solid var(--sae-line); background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; cursor: pointer; font-family: var(--sae-font); transition: border-color 120ms ease; }
.sae-entry-option:disabled { opacity: .5; cursor: not-allowed; }
.sae-entry-option:hover:not(:disabled) { border-color: var(--sae-blue); }
.sae-entry-option .sae-icon-tile { width: 36px; height: 36px; border-radius: 10px; background: var(--sae-mist); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--sae-blue); }
.sae-entry-option .sae-title { font-weight: 700; font-size: calc(var(--sae-body-size) * 1.04); color: var(--sae-navy); }
.sae-entry-option .sae-sub { font-size: calc(var(--sae-body-size) * 0.86); color: var(--sae-muted); margin-top: 1px; }

.sae-back { display: flex; align-items: center; gap: 5px; background: none; border: none; color: var(--sae-muted); font-size: calc(var(--sae-body-size) * 0.89); cursor: pointer; padding: 0; margin-bottom: 12px; font-family: var(--sae-font); }

.sae-dropzone { width: 100%; border: 1.5px solid var(--sae-line); background: #fff; border-radius: 16px; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; }
.sae-dropzone .sae-icon-tile { width: 44px; height: 44px; border-radius: 12px; background: var(--sae-mist); display: flex; align-items: center; justify-content: center; color: var(--sae-blue); }
.sae-dropzone .sae-title { font-weight: 700; font-size: calc(var(--sae-body-size) * 1.04); color: var(--sae-navy); text-align: center; }
.sae-dropzone .sae-sub { font-size: calc(var(--sae-body-size) * 0.86); color: var(--sae-muted); text-align: center; margin-top: 2px; }

.sae-field { margin-bottom: 12px; }
.sae-field label { display: block; font-size: calc(var(--sae-body-size) * 0.86); font-weight: 700; color: var(--sae-muted); margin-bottom: 6px; }
.sae-field input, .sae-field select { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1.5px solid var(--sae-line); font-size: var(--sae-body-size); font-family: var(--sae-font); color: var(--sae-ink); }
.sae-field input:focus, .sae-field select:focus { outline: none; border-color: var(--sae-blue); }

.sae-btn-primary { width: 100%; background: var(--sae-navy); color: #fff; border: none; border-radius: 12px; padding: 14px 20px; font-weight: 700; font-size: calc(var(--sae-body-size) * 1.04); cursor: pointer; font-family: var(--sae-font); display: flex; align-items: center; justify-content: center; gap: 8px; }
.sae-btn-primary:disabled { background: #CBD5E1; cursor: not-allowed; }
.sae-btn-gold { width: 100%; background: var(--sae-gold); color: var(--sae-ink); border: none; border-radius: 12px; padding: 15px 20px; font-weight: 800; font-size: calc(var(--sae-body-size) * 1.04); cursor: pointer; font-family: var(--sae-font); }

.sae-loading { text-align: center; padding: 70px 0; }
.sae-loading .sae-title { font-weight: 700; color: var(--sae-navy); margin-top: 16px; font-size: var(--sae-body-size); }
.sae-loading .sae-sub { font-size: calc(var(--sae-body-size) * 0.86); color: var(--sae-muted); margin-top: 4px; }
.sae-spinner { width: 26px; height: 26px; border: 3px solid var(--sae-mist); border-top-color: var(--sae-blue); border-radius: 50%; animation: sae-spin 0.8s linear infinite; margin: 0 auto; }
@keyframes sae-spin { to { transform: rotate(360deg); } }

.sae-error { display: flex; gap: 8px; background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; border-radius: 12px; padding: 12px; font-size: calc(var(--sae-body-size) * 0.96); margin-top: 12px; }

/* Results */
.sae-results-hero { text-align: center; margin-bottom: 24px; }
.sae-results-badge { display: inline-flex; align-items: center; gap: 6px; background: #E6F8FF; color: var(--sae-blue); border-radius: 999px; padding: 5px 12px; font-size: calc(var(--sae-body-size) * 0.86); font-weight: 700; }
.sae-results-figure { font-weight: 800; font-size: calc(var(--sae-heading-size) * 1.375); color: var(--sae-navy); margin-top: 14px; line-height: 1; }
.sae-results-figure span { font-size: calc(var(--sae-body-size) * 1.07); color: var(--sae-muted); font-weight: 500; }
.sae-results-caption { color: var(--sae-muted); font-size: calc(var(--sae-body-size) * 0.93); margin-top: 6px; }

.sae-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.sae-stat-card { background: #fff; border: 1px solid var(--sae-line); border-radius: 14px; padding: 14px 16px; }
.sae-stat-card .sae-stat-label { display: flex; align-items: center; gap: 6px; font-size: calc(var(--sae-body-size) * 0.82); color: var(--sae-muted); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 8px; }
.sae-stat-card .sae-stat-value { font-weight: 800; font-size: calc(var(--sae-heading-size) * 0.625); color: var(--sae-navy); }

.sae-product-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.sae-product-card { border: 2px solid var(--sae-line); border-radius: 16px; padding: 12px; display: flex; align-items: flex-start; gap: 14px; cursor: pointer; background: #fff; text-align: left; }
.sae-product-card.active { border-color: var(--sae-blue); background: #E6F8FF; }
.sae-product-card img { width: 96px; height: 96px; flex-shrink: 0; object-fit: cover; border-radius: 12px; background: var(--sae-mist); }
.sae-product-card .sae-product-body { flex: 1; min-width: 0; }
.sae-product-card .sae-product-title { font-weight: 700; font-size: calc(var(--sae-body-size) * 1.0); color: var(--sae-navy); }
.sae-product-card .sae-product-sub { font-size: calc(var(--sae-body-size) * 0.86); color: var(--sae-muted); margin-top: 1px; }
.sae-product-features { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sae-product-features li { display: flex; align-items: flex-start; gap: 6px; font-size: calc(var(--sae-body-size) * 0.86); color: var(--sae-ink); line-height: 1.35; }
.sae-product-features li svg { flex-shrink: 0; margin-top: 2px; color: #16A34A; }

.sae-lead-form .sae-field { margin-bottom: 10px; }
.sae-disclaimer { font-size: calc(var(--sae-body-size) * 0.79); color: var(--sae-muted); text-align: center; margin: 6px 0 20px; }

.sae-thankyou { text-align: center; padding: 40px 20px; }
.sae-thankyou .sae-title { font-weight: 800; font-size: calc(var(--sae-heading-size) * 0.6875); color: var(--sae-navy); margin-bottom: 8px; }
.sae-thankyou .sae-text { color: var(--sae-muted); font-size: var(--sae-body-size); }

/* Full breakdown (restored detail view) */
.sae-breakdown-toggle { background: none; border: none; color: var(--sae-blue); font-weight: 700; font-size: calc(var(--sae-body-size) * 0.93); cursor: pointer; padding: 0; margin: 4px 0 16px; font-family: var(--sae-font); display: flex; align-items: center; gap: 4px; }
.sae-breakdown { background: #fff; border: 1px solid var(--sae-line); border-radius: 14px; padding: 4px 16px; margin-bottom: 16px; }
.sae-breakdown-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--sae-line); font-size: calc(var(--sae-body-size) * 0.93); }
.sae-breakdown-row:last-child { border-bottom: none; }
.sae-breakdown-row .label { color: var(--sae-muted); }
.sae-breakdown-row .value { font-weight: 700; color: var(--sae-navy); }
.sae-breakdown-section-label { font-size: calc(var(--sae-body-size) * 0.79); text-transform: uppercase; letter-spacing: .4px; color: var(--sae-muted); padding-top: 14px; font-weight: 700; }
.sae-breakdown-section-label:first-child { padding-top: 12px; }
