/* ========== ALCO OVERHEAD DOOR - SHARED STYLES ========== */
:root {
  --primary: #b33939;
  --primary-dark: #8b1a1a;
  --primary-light: #d04848;
  --accent: #2c3e50;
  --accent-dark: #1a252f;
  --accent-light: #34495e;
  --success: #27ae60;
  --danger: #c0392b;
  --gray-50: #f8f9fa;
  --gray-100: #f0f2f5;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--gray-100); color: #333;
  min-height: 100vh; overflow-x: hidden; width: 100%; max-width: 100vw;
}

/* ===== HEADER ===== */
.header {
  background: white; color: var(--gray-800); padding: 12px 20px; text-align: center;
  border-bottom: 3px solid var(--primary);
}
.header-top { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.header .logo { height: 60px; }
.header h1 { font-size: 1.4em; margin-bottom: 0; letter-spacing: 0.5px; color: var(--primary-dark); display: none; }
.header .portal-label { font-size: 0.88em; color: var(--primary); font-weight: 700; margin-top: 2px; }
.header .phone-bar { font-size: 0.85em; color: var(--gray-600); }
.header .phone-bar a { color: var(--primary); font-weight: 700; text-decoration: none; }
.header p { opacity: 0.6; font-size: 0.8em; font-style: italic; color: var(--gray-500); }
.header-nav {
  display: flex; justify-content: center; gap: 4px; margin-top: 10px; flex-wrap: wrap;
  background: var(--primary-dark); margin: 10px -20px -12px; padding: 0;
}
.header-nav a {
  color: rgba(255,255,255,0.9); text-decoration: none; font-size: 0.88em;
  padding: 10px 18px; transition: all 0.2s;
}
.header-nav a:hover, .header-nav a.active {
  background: var(--primary); color: white;
}

/* ===== CONTAINERS ===== */
.container { max-width: 520px; margin: 30px auto; padding: 0 16px; }
.container-wide { max-width: 960px; margin: 30px auto; padding: 0 16px; }
.container-full { max-width: 1200px; margin: 30px auto; padding: 0 16px; }

/* ===== CARDS ===== */
.card {
  background: white; border-radius: var(--radius); padding: 28px 24px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 1.2em; color: var(--primary-dark); margin-bottom: 4px; }
.card .subtitle { color: var(--gray-500); font-size: 0.88em; margin-bottom: 20px; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; font-size: 0.85em; margin-bottom: 4px; color: var(--gray-600); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--gray-300); border-radius: 8px;
  font-size: 0.95em; transition: border-color 0.2s; background: white;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); outline: none;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== BUTTONS ===== */
.btn {
  padding: 11px 20px; font-size: 0.95em; font-weight: 700; border-radius: 8px;
  cursor: pointer; border: none; transition: all 0.2s; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-outline { background: white; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 7px 14px; font-size: 0.85em; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== TABS ===== */
.tabs {
  display: flex; border-radius: 8px; overflow: hidden;
  border: 2px solid var(--primary); margin-bottom: 20px;
}
.tabs button {
  flex: 1; padding: 10px; font-size: 0.92em; font-weight: 700; cursor: pointer;
  border: none; background: white; color: var(--primary); transition: all 0.2s;
}
.tabs button.active { background: var(--primary); color: white; }
.tabs button:hover:not(.active) { background: rgba(179,57,57,0.06); }

/* ===== MESSAGES ===== */
.msg { padding: 12px 16px; border-radius: 8px; font-size: 0.88em; margin-bottom: 14px; display: none; }
.msg.error { background: #fee2e2; color: var(--danger); border: 1px solid #fecaca; display: block; }
.msg.success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; display: block; }
.msg.info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; display: block; }

/* ===== PANELS ===== */
.panel { display: none; }
.panel.active { display: block; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
th { background: var(--primary); color: white; padding: 10px 12px; text-align: left; font-weight: 600; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--gray-200); }
tr:hover td { background: rgba(179,57,57,0.03); }

/* ===== BADGES ===== */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 0.78em; font-weight: 700;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-denied { background: #fee2e2; color: #991b1b; }

/* ===== LOADING ===== */
.loading { text-align: center; padding: 40px; color: var(--gray-500); }
.spinner {
  display: inline-block; width: 28px; height: 28px; border: 3px solid var(--gray-300);
  border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== PRICING GRID ===== */
.pricing-grid {
  display: grid; gap: 8px; margin-bottom: 16px;
}
.pricing-grid .option-card {
  border: 2px solid var(--gray-200); border-radius: 8px; padding: 12px 14px;
  cursor: pointer; transition: all 0.2s; background: white;
}
.pricing-grid .option-card:hover { border-color: var(--primary-light); }
.pricing-grid .option-card.selected { border-color: var(--primary); background: rgba(179,57,57,0.04); }
.pricing-grid .option-card .name { font-weight: 700; font-size: 0.92em; }
.pricing-grid .option-card .price { color: var(--accent); font-weight: 600; font-size: 0.88em; }
.pricing-grid .option-card .desc { color: var(--gray-500); font-size: 0.82em; margin-top: 2px; }

/* ===== QUOTE SUMMARY ===== */
.quote-summary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white; border-radius: var(--radius); padding: 24px; margin-top: 20px;
}
.quote-summary h3 { font-size: 1.1em; margin-bottom: 12px; opacity: 0.9; }
.quote-summary .line-item { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.9em; opacity: 0.85; }
.quote-summary .total { display: flex; justify-content: space-between; padding: 12px 0 0; margin-top: 8px; border-top: 1px solid rgba(255,255,255,0.2); font-size: 1.2em; font-weight: 700; }

/* ===== SECTION HEADERS ===== */
.section-header {
  font-size: 1em; font-weight: 700; color: var(--primary-dark); margin: 20px 0 10px;
  padding-bottom: 6px; border-bottom: 2px solid var(--accent);
}

/* ===== BACK LINK ===== */
.back-link {
  display: block; text-align: center; margin-top: 16px;
  font-size: 0.88em; color: var(--primary); text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* ===== FOOTER ===== */
.footer {
  text-align: center; padding: 20px; margin-top: 40px;
  color: var(--gray-400); font-size: 0.82em; border-top: 1px solid var(--gray-200);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header { padding: 16px 12px; }
  .header h1 { font-size: 1.3em; }
  .card { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .header-nav { gap: 8px; }
  .header-nav a { font-size: 0.82em; padding: 5px 10px; }
}

/* ===== AUTOCOMPLETE ===== */
.autocomplete-wrapper { position: relative; }
.autocomplete-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
  background: white; border: 1.5px solid var(--gray-300); border-top: none;
  border-radius: 0 0 8px 8px; max-height: 180px; overflow-y: auto;
  box-shadow: var(--shadow); display: none;
}
.autocomplete-item {
  padding: 10px 14px; font-size: 0.9em; cursor: pointer; border-bottom: 1px solid var(--gray-100);
}
.autocomplete-item:hover { background: rgba(179,57,57,0.05); color: var(--primary); }

/* ===== CHECKBOX / TOGGLE ===== */
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.checkbox-row label { font-weight: 500; font-size: 0.9em; cursor: pointer; margin-bottom: 0; }
.checkbox-row .price-tag { margin-left: auto; color: var(--accent); font-weight: 600; font-size: 0.88em; }
