/* ==========================================================================
   🌾 HIGHBEAM ENGINEERING - ULTRA MODERN MOBILE-FIRST UI SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #1e3a8a;
  --primary-light: #2563eb;
  --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  --accent-gold: #f59e0b;
  --accent-emerald: #10b981;
  --accent-cyan: #0284c7;
  
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.12);
  --shadow-hero: 0 12px 30px -5px rgba(30, 58, 138, 0.35);

  --font-family: 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 75px; /* Space for mobile sticky footer */
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ==========================================================================
   1. NAVBAR
   ========================================================================== */
.navbar {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border-bottom: 2px solid var(--accent-gold);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ffffff;
}

.brand-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--accent-gold);
  font-weight: 600;
  letter-spacing: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-nav-link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-nav-link:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.1);
}

.btn-contact {
  background: var(--accent-gold);
  color: #0f172a;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.btn-contact:hover {
  background: #d97706;
  transform: translateY(-1px);
}

/* ==========================================================================
   2. PAGE HEADER & PRESET CHIPS
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 24px 0 40px;
}

.page-header {
  text-align: center;
  margin-bottom: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.back-link:hover {
  color: var(--primary-light);
  border-color: #93c5fd;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
}

.page-header h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  line-height: 1.3;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 580px;
  margin: 0 auto;
}

/* Presets (Horizontal Smooth Swipe on Mobile) */
.presets-wrapper {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.preset-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.preset-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.preset-label i {
  color: var(--accent-gold);
}

.swipe-hint {
  font-size: 0.75rem;
  color: var(--text-light);
}

.preset-chips-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.preset-chips-scroll::-webkit-scrollbar {
  display: none;
}

.preset-chips {
  display: flex;
  gap: 8px;
  padding-bottom: 2px;
}

.chip {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chip:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
  background: #eff6ff;
}

.chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

/* ==========================================================================
   3. CALCULATOR GRID & CARDS
   ========================================================================== */
.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #f1f5f9;
}

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  background: #dcfce7;
  color: #15803d;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-group label i {
  color: var(--primary-light);
  margin-right: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Input Fields */
.input-container {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
  height: 52px;
}

.input-container:focus-within {
  border-color: var(--border-focus);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-container input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-family: var(--font-family);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
  width: 100%;
}

.input-suffix {
  padding: 0 16px;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 1rem;
  background: #e2e8f0;
  height: 100%;
  display: flex;
  align-items: center;
}

.unit-select {
  border: none;
  background: #e2e8f0;
  font-family: var(--font-family);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  padding: 0 14px;
  height: 100%;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

.unit-select:hover {
  background: #cbd5e1;
}

/* Form Actions */
.form-actions {
  margin-top: 24px;
}

.btn-reset {
  width: 100%;
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-reset:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

/* ==========================================================================
   4. RESULTS DISPLAY (HERO CARD & METRICS)
   ========================================================================== */
.result-card {
  display: flex;
  flex-direction: column;
}

.hero-result-card {
  background: var(--primary-gradient);
  color: #ffffff;
  padding: 24px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-hero);
  position: relative;
  overflow: hidden;
}

.hero-result-card::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero-result-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: #93c5fd;
  margin-bottom: 6px;
}

.hero-result-value-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.hero-result-number {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  letter-spacing: -1px;
}

.hero-result-unit {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.hero-result-sub {
  font-size: 0.85rem;
  color: #cbd5e1;
}

/* Progress / Ratio Bar */
.visual-comparison-bar {
  margin: 16px 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  height: 8px;
  display: flex;
  overflow: hidden;
}

.comp-bar-dry {
  background: #22c55e;
  height: 100%;
  transition: width 0.3s ease;
}

.comp-bar-water {
  background: #38bdf8;
  height: 100%;
  transition: width 0.3s ease;
}

.comp-ratio-text {
  font-size: 0.76rem;
  color: #94a3b8;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
}

/* 2-Column Metrics Sub Grid */
.metrics-sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.metric-sub-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.metric-icon-pill {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.pill-water { background: #e0f2fe; color: #0284c7; }
.pill-loss { background: #fee2e2; color: #dc2626; }
.pill-land { background: #e0e7ff; color: #4338ca; }
.pill-save { background: #dcfce7; color: #16a34a; }

.metric-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.metric-sub-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.metric-sub-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

/* Copy Button */
.btn-copy-summary {
  width: 100%;
  background: #0f172a;
  color: #ffffff;
  border: none;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.btn-copy-summary:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

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

/* Toast Message */
.toast-msg {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #10b981;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   5. MOBILE RESPONSIVENESS & TOUCH OPTIMIZATIONS
   ========================================================================== */
@media (max-width: 820px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
  .page-header h1 {
    font-size: 1.55rem;
  }
  .card {
    padding: 18px;
  }
  .hero-result-number {
    font-size: 2.3rem;
  }
  .hero-result-card {
    padding: 18px;
  }
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .metrics-sub-grid {
    grid-template-columns: 1fr;
  }
  .brand-title {
    font-size: 0.95rem;
  }
  .brand-subtitle {
    display: none;
  }
}

/* ==========================================================================
   6. SEO CONTENT, TABLES, FAQ ACCORDION & SOCIAL SHARE
   ========================================================================== */

/* Social Share Toolbar */
.share-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0 28px 0;
  padding: 12px 18px;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.share-toolbar-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.share-btn-line {
  background: #06c755;
  color: #ffffff;
}
.share-btn-line:hover {
  background: #05b04b;
  transform: translateY(-1px);
}

.share-btn-fb {
  background: #1877f2;
  color: #ffffff;
}
.share-btn-fb:hover {
  background: #0d6efd;
  transform: translateY(-1px);
}

.share-btn-copy {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}
.share-btn-copy:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

/* SEO Educational Content Section */
.seo-content-section {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.content-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}

.content-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.content-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
  margin: 18px 0 8px 0;
}

.content-card p {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.7;
  margin-bottom: 12px;
}

.content-card ul, .content-card ol {
  padding-left: 22px;
  margin-bottom: 14px;
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.75;
}

.formula-highlight-box {
  background: #f8fafc;
  border-left: 4px solid #2563eb;
  padding: 14px 18px;
  margin: 14px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: 'Inter', monospace;
  font-size: 0.96rem;
  color: #1e293b;
  overflow-x: auto;
}

/* Reference Tables */
.reference-table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.reference-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.reference-table th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 2px solid #cbd5e1;
}

.reference-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}

.reference-table tr:last-child td {
  border-bottom: none;
}

.reference-table tr:nth-child(even) {
  background: #fafafa;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item[open] {
  border-color: #93c5fd;
}

.faq-question {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.98rem;
  color: #1e293b;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  background: #f8fafc;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.8rem;
  color: #64748b;
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
  transform: rotate(180deg);
  color: #2563eb;
}

.faq-answer {
  padding: 16px 18px;
  font-size: 0.93rem;
  color: #475569;
  line-height: 1.7;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

/* Related Tools Section */
.related-tools-section {
  margin-top: 36px;
}

.related-tools-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.related-tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.related-tool-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: var(--shadow-md);
}

.related-tool-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.related-tool-info {
  flex: 1;
}

.related-tool-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 2px;
}

.related-tool-sub {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.3;
}

