/* Pinks EWI Calculator — v1.0.2 */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

.ewi-calc-wrap {
  --ewi-pink:         #F72EA0;
  --ewi-pink-dark:    #c9197e;
  --ewi-pink-light:   rgba(247, 46, 160, 0.12);
  --ewi-dark:         #141414;
  --ewi-dark2:        #1e1e1e;
  --ewi-dark3:        #252525;
  --ewi-surface:      #ffffff;
  --ewi-surface2:     #f7f7f7;
  --ewi-border:       #e4e4e4;
  --ewi-border-dark:  rgba(255,255,255,0.1);
  --ewi-text:         #141414;
  --ewi-text-mid:     #555555;
  --ewi-text-muted:   #999999;
  --ewi-text-white:   #ffffff;
  --ewi-green:        #1a9e5c;
  --ewi-green-light:  #eaf7f0;
  --ewi-r:            10px;
  --ewi-rs:           6px;
  font-family: 'DM Sans', sans-serif;
  color: var(--ewi-text);
  background: var(--ewi-dark);
  /* Break out of page content max-width constraints */
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.ewi-calc-wrap *, .ewi-calc-wrap *::before, .ewi-calc-wrap *::after {
  box-sizing: border-box;
}

/* ── Fixed video background — scoped to calculator only ── */
.ewi-calc-wrap {
  position: relative;
  isolation: isolate;
}

.ewi-video-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.ewi-video-bg video {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  object-fit: cover;
  display: block;
  image-rendering: high-quality;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

.ewi-video-bg-overlay {
  display: none;
}

/* ── Hero ── */
.ewi-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.ewi-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.5rem;
  max-width: 700px;
}

.ewi-hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ewi-pink);
  margin-bottom: 16px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.ewi-hero-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  color: var(--ewi-text-white);
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  text-shadow:
    0 0 30px rgba(0,0,0,0.6),
    1px 1px 0 rgba(0,0,0,0.5),
    -1px -1px 0 rgba(0,0,0,0.5),
    1px -1px 0 rgba(0,0,0,0.5),
    -1px 1px 0 rgba(0,0,0,0.5),
    0 2px 12px rgba(0,0,0,0.7);
}

.ewi-hero-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.9);
  margin: 0 0 24px;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9), 0 2px 12px rgba(0,0,0,0.7);
}

.ewi-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(247,46,160,0.25);
  border: 1px solid rgba(247,46,160,0.6);
  border-radius: 100px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── Cards wrapper ───────────────────────────────────────────────── */
.ewi-cards-wrap {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: -2rem auto 0;
  padding: 2rem 1.5rem 4rem;
  border-radius: 16px 16px 0 0;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.ewi-card {
  background: var(--ewi-surface);
  border: 1px solid var(--ewi-border);
  border-radius: var(--ewi-r);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.ewi-card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ewi-text-muted);
  margin-bottom: 14px;
}

/* ── Job type ────────────────────────────────────────────────────── */
.ewi-job-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ewi-job-option {
  position: relative;
  cursor: pointer;
}

.ewi-job-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ewi-job-face {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  border: 1.5px solid var(--ewi-border);
  border-radius: var(--ewi-rs);
  background: var(--ewi-surface2);
  transition: all 0.15s;
}

.ewi-jf-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ewi-text-mid);
}

.ewi-jf-sub {
  font-size: 11px;
  color: var(--ewi-text-muted);
}

.ewi-job-option input:checked + .ewi-job-face {
  border-color: var(--ewi-pink);
  background: var(--ewi-surface);
}

.ewi-job-option input:checked + .ewi-job-face .ewi-jf-title {
  color: var(--ewi-pink);
  font-weight: 600;
}

/* ── Thickness ───────────────────────────────────────────────────── */
.ewi-thick-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ewi-thick-btn {
  padding: 7px 13px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  border: 1.5px solid var(--ewi-border);
  border-radius: var(--ewi-rs);
  background: var(--ewi-surface2);
  color: var(--ewi-text-mid);
  cursor: pointer;
  transition: all 0.12s;
}

.ewi-thick-btn:hover {
  border-color: var(--ewi-pink);
  color: var(--ewi-pink);
}

.ewi-thick-btn.active {
  background: var(--ewi-pink);
  border-color: var(--ewi-pink);
  color: #fff;
  font-weight: 600;
}

.ewi-hint {
  font-size: 11px;
  color: var(--ewi-text-muted);
  margin-top: 10px;
  margin-bottom: 0;
}

/* ── Area ────────────────────────────────────────────────────────── */
.ewi-area-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ewi-area-wrap {
  position: relative;
  max-width: 150px;
}

.ewi-area-wrap input {
  width: 100%;
  padding: 10px 40px 10px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 20px;
  font-weight: 600;
  border: 1.5px solid var(--ewi-border);
  border-radius: var(--ewi-rs);
  background: var(--ewi-surface);
  color: var(--ewi-text);
  outline: none;
  transition: border-color 0.15s;
}

.ewi-area-wrap input:focus {
  border-color: var(--ewi-pink);
}

.ewi-area-unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--ewi-text-muted);
  pointer-events: none;
}

.ewi-select {
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  border: 1.5px solid var(--ewi-border);
  border-radius: var(--ewi-rs);
  background: var(--ewi-surface);
  color: var(--ewi-text);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.ewi-select:focus {
  border-color: var(--ewi-pink);
}

/* ── Product toggles ─────────────────────────────────────────────── */
.ewi-toggle-row {
  display: flex;
  gap: 6px;
}

.ewi-prod-btn {
  padding: 8px 20px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--ewi-border);
  border-radius: var(--ewi-rs);
  background: var(--ewi-surface2);
  color: var(--ewi-text-mid);
  cursor: pointer;
  transition: all 0.12s;
  letter-spacing: 0.03em;
}

.ewi-prod-btn:hover {
  border-color: var(--ewi-pink);
  color: var(--ewi-pink);
}

.ewi-prod-btn.active {
  background: var(--ewi-pink);
  border-color: var(--ewi-pink);
  color: #fff;
}

/* ── Price loading ───────────────────────────────────────────────── */
.ewi-price-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--ewi-dark2);
  border: 1px solid var(--ewi-border-dark);
  border-radius: var(--ewi-rs);
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1rem;
}

.ewi-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(247,46,160,0.3);
  border-top-color: var(--ewi-pink);
  border-radius: 50%;
  animation: ewi-spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ── Results card ────────────────────────────────────────────────── */
.ewi-results-card {
  background: var(--ewi-surface);
  border: 1px solid var(--ewi-border);
  border-radius: var(--ewi-r);
  overflow: hidden;
  margin-top: 0.5rem;
}

.ewi-results-header {
  background: var(--ewi-pink);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ewi-rh-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

.ewi-rh-area {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 500;
}

/* ── Results table ───────────────────────────────────────────────── */
.ewi-res-table {
  width: 100%;
  border-collapse: collapse;
}

.ewi-res-table thead th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ewi-text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--ewi-border);
  text-align: left;
  background: var(--ewi-surface2);
}

.ewi-res-table thead th:nth-child(2),
.ewi-res-table thead th:nth-child(3),
.ewi-res-table thead th:nth-child(4) { text-align: right; }

.ewi-res-table tbody tr { border-bottom: 1px solid var(--ewi-border); }
.ewi-res-table tbody tr:last-child { border-bottom: none; }

.ewi-res-table tbody tr.ewi-board-row {
  background: rgba(247,46,160,0.05);
}

.ewi-res-table td {
  padding: 12px 16px;
  font-size: 13px;
  vertical-align: middle;
}

.ewi-res-table td:nth-child(2),
.ewi-res-table td:nth-child(3),
.ewi-res-table td:nth-child(4) {
  text-align: right;
  font-family: 'DM Mono', monospace;
  white-space: nowrap;
}

.ewi-td-name {
  font-weight: 600;
  color: var(--ewi-text);
}

.ewi-td-desc {
  font-size: 11px;
  color: var(--ewi-text-muted);
  margin-top: 2px;
}

.ewi-tds-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ewi-green);
  background: var(--ewi-green-light);
  border: 1px solid #a8e6c8;
  border-radius: 3px;
  padding: 1px 5px;
  text-transform: uppercase;
  margin-left: 5px;
  vertical-align: middle;
}

.ewi-price-loading { color: var(--ewi-text-muted); }

/* ── Totals ──────────────────────────────────────────────────────── */
.ewi-totals {
  border-top: 2px solid var(--ewi-dark);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-end;
  background: var(--ewi-surface2);
}

.ewi-total-line {
  display: flex;
  gap: 24px;
  align-items: center;
}

.ewi-tl-label {
  font-size: 13px;
  color: var(--ewi-text-mid);
  min-width: 120px;
  text-align: right;
}

.ewi-tl-val {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: var(--ewi-text);
  min-width: 90px;
  text-align: right;
}

.ewi-total-line.ewi-grand .ewi-tl-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--ewi-text);
}

.ewi-total-line.ewi-grand .ewi-tl-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--ewi-pink);
}

.ewi-results-footer {
  padding: 12px 20px;
  font-size: 11px;
  color: var(--ewi-text-muted);
  background: var(--ewi-surface);
  line-height: 1.6;
  border-top: 1px solid var(--ewi-border);
}

/* ── Actions ─────────────────────────────────────────────────────── */
.ewi-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.ewi-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--ewi-rs);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.ewi-btn-primary {
  background: var(--ewi-pink);
  color: #fff;
  box-shadow: 0 4px 20px rgba(247,46,160,0.35);
}

.ewi-btn-primary:hover {
  background: var(--ewi-pink-dark);
  color: #fff;
  box-shadow: 0 4px 24px rgba(247,46,160,0.5);
  transform: translateY(-1px);
}

.ewi-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ewi-atc-msg {
  font-size: 13px;
  color: var(--ewi-green);
  font-weight: 600;
}

.ewi-atc-msg.error { color: #e53e3e; }

.ewi-disclaimer {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-top: 1.5rem;
  margin-bottom: 0;
  text-align: center;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .ewi-hero { height: 420px; }
  .ewi-hero-title { font-size: 34px; }
  .ewi-job-toggle { grid-template-columns: 1fr; }
  .ewi-res-table thead th:nth-child(3) { display: none; }
  .ewi-res-table td:nth-child(3) { display: none; }
  .ewi-cards-wrap { padding: 1.5rem 1rem 3rem; }
}
