/* ─────────────────────────────────────────────
   BOSS VISION — CLIENT PORTAL
   Dark theme, mobile-first, brand-aligned
   ───────────────────────────────────────────── */

/* ── RESET & BASE ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0a0a0a;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video {
  display: block;
  max-width: 100%;
}

a {
  color: #CC0100;
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  opacity: 0.85;
}

/* ── VARIABLES ── */
:root {
  --brand: #CC0100;
  --brand-glow: rgba(204, 1, 0, 0.15);
  --brand-border: rgba(204, 1, 0, 0.25);
  --bg: #0a0a0a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);
  --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --container: 720px;
}

/* ── UTILITY ── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.gradient-text {
  background: linear-gradient(135deg, #CC0100 0%, #ff4d4d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-eyebrow {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 40px;
}

.section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}

/* ─────────────────────────────────────────────
   LOADING STATE
   ───────────────────────────────────────────── */
.portal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg);
}

.loader-ring {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loader-text {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────
   ERROR STATE
   ───────────────────────────────────────────── */
.portal-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
}

.error-card {
  text-align: center;
  max-width: 420px;
}

.error-icon {
  font-size: 48px;
  margin-bottom: 24px;
}

.error-card h1 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.error-card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.error-contact {
  margin-top: 32px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.error-contact-detail {
  font-weight: 600;
  color: var(--text-primary);
  margin: 8px 0;
}

.error-contact-link {
  display: block;
  margin: 6px 0;
  font-size: 14px;
}

/* ─────────────────────────────────────────────
   HEADER (sticky)
   ───────────────────────────────────────────── */
.portal-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.portal-header.visible {
  transform: translateY(0);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-company {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-cta-btn {
  padding: 8px 20px;
  background: var(--brand);
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s;
}

.header-cta-btn:hover {
  opacity: 0.9;
}

/* ─────────────────────────────────────────────
   SECTION 1: HERO
   ───────────────────────────────────────────── */
.section-hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  padding: 0;
  border-bottom: none;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-video,
.hero-night-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-fallback {
  width: 100%;
  height: 100%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 10, 10, 0.95) 0%,
    rgba(10, 10, 10, 0.6) 40%,
    rgba(10, 10, 10, 0.2) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 24px 80px;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 8px;
}

.hero-address {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.hero-prepared {
  font-size: 14px;
  color: var(--text-muted);
}

.hero-prepared strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--brand);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ─────────────────────────────────────────────
   SECTION 2: NIGHT RENDER
   ───────────────────────────────────────────── */
.render-wrapper {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.render-image {
  width: 100%;
  display: block;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.render-philosophy {
  font-size: 16px;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─────────────────────────────────────────────
   SECTION 3: SYSTEM OVERVIEW
   ───────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  text-align: center;
  padding: 28px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.3s;
}

.stat-card:hover {
  border-color: var(--brand-border);
}

.stat-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Categories */
.categories-list {
  margin-bottom: 40px;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.category-item:last-child {
  border-bottom: none;
}

.category-info {
  flex: 1;
}

.category-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.category-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.category-count {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
  margin-left: 16px;
}

/* Confidence */
.confidence-block {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.confidence-badge {
  text-align: center;
  margin-bottom: 24px;
}

.confidence-grade {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
}

.confidence-label {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}

.confidence-breakdown {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.confidence-item {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.confidence-item-grade {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.confidence-item-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.confidence-item-headline {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ─────────────────────────────────────────────
   SECTION 4: INVESTMENT
   ───────────────────────────────────────────── */
.investment-hero-card {
  text-align: center;
  padding: 48px 32px;
  background: var(--brand-glow);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-xl);
  margin-bottom: 32px;
}

.investment-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
}

.investment-amount {
  font-family: var(--font-heading);
  font-size: 52px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

/* Savings */
.savings-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.saving-card {
  text-align: center;
  padding: 24px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.saving-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: #22c55e;
  margin-bottom: 6px;
}

.saving-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ROI */
.roi-block {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.roi-card {
  text-align: center;
  padding: 28px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.roi-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.roi-value {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

/* ─────────────────────────────────────────────
   SECTION 5: SAFETY & SECURITY
   ───────────────────────────────────────────── */
.safety-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.safety-card {
  text-align: center;
  padding: 28px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.safety-grade {
  display: block;
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 800;
  color: #22c55e;
  margin-bottom: 8px;
}

.safety-stat {
  display: block;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.safety-card-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Lit Areas */
.lit-areas-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lit-area-tag {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ─────────────────────────────────────────────
   SECTION 6: SYSTEM CARE
   ───────────────────────────────────────────── */
.care-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.care-stat {
  text-align: center;
  padding: 28px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.care-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.care-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Highlights */
.care-highlights {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.care-highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.care-highlight-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 7px;
  background: var(--brand);
  border-radius: 50%;
}

/* ─────────────────────────────────────────────
   SECTION 7: APPROVAL
   ───────────────────────────────────────────── */
.section-approval {
  padding-bottom: 40px;
}

.approval-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
}

/* Buttons */
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px 32px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:active {
  transform: scale(0.98);
}

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

.btn-secondary {
  display: block;
  width: 100%;
  padding: 16px 32px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
  border-color: var(--brand-border);
  color: var(--text-primary);
}

.btn-ghost {
  display: block;
  width: 100%;
  padding: 14px 32px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-ghost:hover {
  color: var(--text-secondary);
}

/* Approval Form */
.approval-form {
  max-width: 440px;
  margin: 0 auto;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.approval-form-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--brand);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-buttons {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Confirmed / Declined states */
.approval-confirmed,
.approval-declined {
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
  padding: 40px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.confirmed-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(34, 197, 94, 0.1);
  border: 2px solid rgba(34, 197, 94, 0.3);
  border-radius: 50%;
  font-size: 24px;
  color: #22c55e;
  margin-bottom: 20px;
}

.approval-confirmed h3,
.approval-declined h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.approval-confirmed p,
.approval-declined p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─────────────────────────────────────────────
   SECTION 8: FOOTER
   ───────────────────────────────────────────── */
.portal-footer {
  padding: 48px 0 64px;
  text-align: center;
}

.footer-contact {
  margin-bottom: 24px;
}

.footer-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.footer-link {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin: 4px 0;
  font-weight: 400;
}

.footer-link:hover {
  color: var(--brand);
}

.footer-expiry {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding: 12px 20px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.footer-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--brand);
  border-radius: 50%;
  animation: badgePulse 2s ease infinite;
}

@keyframes badgePulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.footer-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .section-title {
    font-size: 26px;
    margin-bottom: 32px;
  }

  .section {
    padding: 56px 0;
  }

  /* Hero */
  .hero-title {
    font-size: 30px;
  }

  .hero-content {
    padding: 0 20px 60px;
  }

  /* Stats */
  .stats-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-card {
    padding: 20px 8px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-label {
    font-size: 10px;
  }

  /* Investment */
  .investment-amount {
    font-size: 38px;
  }

  .savings-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .saving-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 16px 20px;
  }

  .saving-value {
    font-size: 20px;
    margin-bottom: 0;
    order: 2;
  }

  .saving-label {
    order: 1;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-secondary);
  }

  /* ROI */
  .roi-block {
    grid-template-columns: 1fr;
  }

  /* Safety */
  .safety-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .safety-grade {
    font-size: 28px;
  }

  .safety-stat {
    font-size: 22px;
  }

  .safety-card-label {
    font-size: 10px;
  }

  /* Care */
  .care-stats {
    grid-template-columns: 1fr;
  }

  /* Confidence */
  .confidence-breakdown {
    grid-template-columns: 1fr;
  }

  .confidence-grade {
    font-size: 40px;
  }

  /* Approval Form */
  .approval-form {
    padding: 24px 20px;
    margin: 0 -4px;
  }
}

@media (max-width: 380px) {
  .stats-row,
  .safety-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 26px;
  }

  .investment-amount {
    font-size: 32px;
  }
}

/* ─────────────────────────────────────────────
   ANIMATIONS (scroll reveal)
   ───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}