/* -------------------------------------------------------------
   AUTOMATEX360 CALCULATOR & BUILDER - STYLESHEET
   Reference Style: Finexy Financial Dashboard Aesthetic
   ------------------------------------------------------------- */
/* --- CUSTOM MINIMAL THEMED SCROLLBARS --- */
html {
  color-scheme: light;
  background-color: var(--bg-dashboard);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

body.dark-theme {
  color-scheme: dark;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent !important;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-coral);
}

body.dark-theme ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
  background: var(--accent-coral);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

body.dark-theme * {
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* --- RESET & COLOR VARIABLES --- */
:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: 'Google Sans Flex', 'Google Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.section-title,
.page-header h1,
.brand-logo,
.estimate-value,
.service-card-title,
.option-label,
.profile-name,
.step-badge,
.nav-link,
.modal-header h3,
.current-service-tag {
  font-family: var(--font-heading);
}

:root {
  --bg-dashboard: #F4F5F8;
  --bg-card: #FFFFFF;
  --accent-coral: #FA5838;
  --accent-coral-hover: #E44728;
  --accent-coral-light: rgba(250, 88, 56, 0.08);
  --accent-coral-glow: rgba(250, 88, 56, 0.25);
  --text-dark: #121316;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --border-color: #EEF0F4;
  --card-radius: 22px;
  --shadow-subtle: 0 8px 24px rgba(0, 0, 0, 0.03);
}

/* Dark Mode Theme Variables */
body.dark-theme {
  --bg-dashboard: #0A0B0D;
  --bg-card: #141518;
  --text-dark: #F3F4F6;
  --text-muted: #9CA3AF;
  --text-light: #6B7280;
  --border-color: #24262C;
  --shadow-subtle: 0 8px 24px rgba(0, 0, 0, 0.5);
}

html,
body {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

body {
  background-color: var(--bg-dashboard);
  color: var(--text-dark);
  padding: 20px 24px;
  display: flex;
  justify-content: center;
  align-items: stretch;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Outer Wrapper Dashboard Container */
.dashboard-app {
  width: 100%;
  max-width: 1600px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  gap: 24px;
  position: relative;
  align-items: stretch;
  overflow: visible;
}

/* --- LEFT FLOATING SIDEBAR --- */
.sidebar-left {
  width: 64px;
  height: 100%;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  overflow: visible;
  z-index: 100;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body.dark-theme .sidebar-left {
  background: #101115;
  border-color: #202228;
  box-shadow: 0 14px 40px -4px rgba(0, 0, 0, 0.75), 0 4px 16px rgba(0, 0, 0, 0.5);
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.theme-toggle-box {
  background: #F4F4F7;
  border-radius: 20px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.dark-theme .theme-toggle-box {
  background: #18191E;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  background: transparent;
}

.icon-btn:hover,
.icon-btn.active {
  background: var(--accent-coral);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(250, 88, 56, 0.3);
}

body.dark-theme .icon-btn:hover,
body.dark-theme .icon-btn.active {
  background: var(--accent-coral);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(250, 88, 56, 0.4);
}

.theme-toggle-box .icon-btn.active {
  background: #FFFFFF;
  color: var(--accent-coral);
  box-shadow: 0 2px 8px rgba(250, 88, 56, 0.2);
}

body.dark-theme .theme-toggle-box .icon-btn.active {
  background: #24262E;
  color: var(--accent-coral);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* --- MAIN CONTENT AREA --- */
.main-content {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow: hidden;
}

.navbar {
  flex-shrink: 0;
}

.page-header {
  flex-shrink: 0;
  margin-bottom: 4px;
}

/* --- MIDDLE VIEWS SCROLL CONTAINER --- */
.views-scroll-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  padding-bottom: 20px;
}

/* --- TOP NAVBAR --- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-dark);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.brand-logo:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.brand-logo-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.4px;
  color: var(--text-dark);
}

body.dark-theme .brand-title {
  color: #FFFFFF;
}

.brand-subtitle {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.1px;
}

.brand-subtitle strong {
  color: var(--accent-coral);
  font-weight: 700;
}

.powered-by-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-coral);
  background: var(--accent-coral-light);
  border: 1px solid rgba(250, 88, 56, 0.2);
  padding: 4px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.powered-by-tag strong {
  font-weight: 800;
}

.powered-by-tag:hover {
  background: var(--accent-coral);
  color: #FFFFFF;
  border-color: var(--accent-coral);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(250, 88, 56, 0.25);
}

.calculator-brand-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
}

.powered-by-footer-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.powered-by-footer-link strong {
  color: var(--accent-coral);
  font-weight: 700;
}

.powered-by-footer-link:hover {
  color: var(--accent-coral);
  transform: translateY(-1px);
}

.footer-divider {
  opacity: 0.4;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-coral);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 800;
  flex-shrink: 0;
}

.nav-pill-menu {
  display: flex;
  background: var(--bg-card);
  padding: 6px;
  border-radius: 30px;
  gap: 4px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-subtle);
  transition: background-color 0.3s ease;
}

.nav-link {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link.active {
  background: var(--accent-coral);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(250, 88, 56, 0.3);
}

body.dark-theme .nav-link.active {
  background: var(--accent-coral);
  box-shadow: 0 4px 14px rgba(250, 88, 56, 0.4);
}

.nav-link:hover:not(.active) {
  color: var(--accent-coral);
  background: var(--accent-coral-light);
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-util-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.nav-util-btn:hover {
  background: var(--accent-coral-light);
  color: var(--accent-coral);
  border-color: rgba(250, 88, 56, 0.3);
}

body.dark-theme .nav-util-btn:hover {
  background: #1E1F24;
  color: #FFFFFF;
}

.notification-dot {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 7px;
  height: 7px;
  background: var(--accent-coral);
  border-radius: 50%;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  padding: 8px 16px 8px 10px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  max-width: 280px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-pill:hover {
  border-color: var(--accent-coral);
}

.profile-avatar-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-coral-light);
  color: var(--accent-coral);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  overflow: hidden;
}

.profile-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-arrow {
  font-size: 9px;
  color: var(--text-muted);
  margin-left: 2px;
  flex-shrink: 0;
}

/* --- PAGE HEADER TITLE --- */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.page-header h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.15;
}

.page-header p {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.5;
}

/* --- VIEW SECTIONS --- */
.view-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- ESTIMATOR CALCULATOR WIZARD CARD & COMPONENTS --- */
.calculator-card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  margin-bottom: 24px;
}

.sticky-ticker-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 20;
}

.ticker-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-badge {
  background: rgba(250, 88, 56, 0.1);
  color: var(--accent-coral);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(250, 88, 56, 0.2);
}

.current-service-tag {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
}

.live-estimate-badge {
  text-align: right;
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.25);
  padding: 8px 18px;
  border-radius: 16px;
}

.estimate-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #16A34A;
  font-weight: 700;
}

.estimate-value {
  font-size: 24px;
  font-weight: 800;
  color: #16A34A;
}

.progress-bar-container {
  height: 4px;
  background: #F4F4F7;
  width: 100%;
}

body.dark-theme .progress-bar-container {
  background: #1E1F24;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-coral);
  width: 0%;
  transition: width 0.3s ease;
}

.calculator-body {
  padding: 36px 40px;
}

.section-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 10px;
  line-height: 1.2;
}

.section-desc {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 32px;
  font-weight: 500;
  line-height: 1.6;
}

/* Service Selection Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 26px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-coral);
  box-shadow: 0 12px 28px rgba(250, 88, 56, 0.12);
}

.service-card.selected {
  border-color: var(--accent-coral);
  background: rgba(250, 88, 56, 0.04);
  box-shadow: 0 0 0 2px var(--accent-coral);
}

.service-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: #F4F4F7;
  color: var(--accent-coral);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 18px;
}

body.dark-theme .service-card-icon {
  background: #1E1F24;
}

.service-card-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.4px;
}

.service-card-base {
  font-size: 14px;
  color: #16A34A;
  font-weight: 700;
}

/* Question Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.option-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  padding: 22px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
}

.option-card:hover {
  border-color: var(--accent-coral);
}

.option-card.selected {
  border-color: var(--accent-coral);
  background: rgba(250, 88, 56, 0.05);
  box-shadow: 0 0 0 2px var(--accent-coral);
}

.checkbox-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s ease;
}

.option-card.selected .checkbox-circle {
  border-color: var(--accent-coral);
  background: var(--accent-coral);
  color: #FFFFFF;
}

.option-content {
  flex-grow: 1;
}

.option-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.option-price-range {
  font-size: 12px;
  color: #16A34A;
  font-weight: 700;
}

.option-price-zero {
  font-size: 12px;
  color: var(--text-muted);
}

/* Wizard Navigation Buttons */
.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.btn {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-secondary {
  background: #F4F4F7;
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

body.dark-theme .btn-secondary {
  background: #1E1F24;
  color: #F3F4F6;
}

.btn-secondary:hover {
  background: #EAEAEF;
}

body.dark-theme .btn-secondary:hover {
  background: #282A30;
}

.btn-primary {
  background: var(--accent-coral);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(250, 88, 56, 0.25);
}

.btn-primary:hover {
  background: var(--accent-coral-hover);
  box-shadow: 0 6px 18px rgba(250, 88, 56, 0.35);
  transform: translateY(-1px);
}

body.dark-theme .btn-primary {
  background: var(--accent-coral);
}

body.dark-theme .btn-primary:hover {
  background: var(--accent-coral-hover);
}

.btn-success {
  background: var(--accent-coral);
  color: #FFFFFF;
}

.btn-success:hover {
  background: var(--accent-coral-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

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

/* Contact Lead Form */
.lead-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.form-input,
.form-textarea {
  background: #F4F4F7;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 10px 14px;
  color: var(--text-dark);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
}

body.dark-theme .form-input,
body.dark-theme .form-textarea {
  background: #1E1F24;
  border-color: #24262C;
  color: #FFFFFF;
}

.form-select {
  background-color: #F4F4F7;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 10px 38px 10px 14px;
  color: var(--text-dark);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  cursor: pointer;
}

body.dark-theme .form-select {
  background-color: #1E1F24;
  color: #FFFFFF;
  border-color: #24262C;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* --- CUSTOM UI SELECT DROPDOWNS --- */
.custom-select-container {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.custom-select-trigger {
  width: 100%;
  background: #F4F4F7;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 9px 14px;
  color: var(--text-dark);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

body.dark-theme .custom-select-trigger {
  background: #1E1F24;
  border-color: #24262C;
  color: #FFFFFF;
}

.custom-select-trigger:hover,
.custom-select-container.open .custom-select-trigger {
  border-color: var(--accent-coral);
  box-shadow: 0 0 0 3px var(--accent-coral-light);
}

body.dark-theme .custom-select-container.open .custom-select-trigger {
  box-shadow: 0 0 0 3px var(--accent-coral-glow);
}

.custom-select-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
  color: var(--text-muted);
}

.custom-select-container.open .custom-select-chevron {
  transform: rotate(180deg);
  color: var(--accent-coral);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 180px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  animation: fadeIn 0.15s ease;
}

body.dark-theme .custom-select-menu {
  background: #18191E;
  border-color: #26282E;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.custom-select-container.open .custom-select-menu {
  display: flex;
}

.custom-select-item {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.dark-theme .custom-select-item {
  color: #F3F4F6;
}

.custom-select-item:hover {
  background: var(--accent-coral-light);
  color: var(--accent-coral);
}

.custom-select-item.selected {
  background: var(--accent-coral);
  color: #FFFFFF !important;
  font-weight: 700;
}

/* Hide clunky native browser spin buttons */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-coral);
  box-shadow: 0 0 0 3px var(--accent-coral-light);
  background: #FFFFFF;
  color: var(--text-dark);
}

body.dark-theme .form-input:focus,
body.dark-theme .form-select:focus,
body.dark-theme .form-textarea:focus {
  border-color: var(--accent-coral);
  box-shadow: 0 0 0 3px var(--accent-coral-glow);
  background: #141518;
  color: #FFFFFF;
}

/* --- FORM & PRICE BUILDER (ADMIN CRUD) --- */
.builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.service-selector-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.service-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  line-height: 1;
}

.service-tab-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  display: block;
}

.service-tab-btn.active {
  background: var(--accent-coral);
  color: #FFFFFF;
  border-color: var(--accent-coral);
  box-shadow: 0 4px 14px rgba(250, 88, 56, 0.3);
}

body.dark-theme .service-tab-btn.active {
  background: var(--accent-coral);
  border-color: var(--accent-coral);
}

.service-edit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 32px 36px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-subtle);
}

.service-meta-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.question-builder-card {
  background: #FAFAFC;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 26px;
  margin-bottom: 22px;
}

body.dark-theme .question-builder-card {
  background: #1A1B20;
}

.question-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.question-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.action-btn-icon:hover {
  background: #18181B;
  color: #FFFFFF;
}

body.dark-theme .action-btn-icon:hover {
  background: var(--accent-coral);
}

.options-builder-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.option-builder-row {
  display: grid;
  grid-template-columns: auto 3fr 1.5fr 1.5fr auto;
  gap: 12px;
  align-items: center;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.price-range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-with-prefix {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-prefix {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  z-index: 2;
}

.input-with-prefix .form-input {
  padding-left: 24px;
  padding-right: 28px;
  width: 100%;
}

.stepper-btn-group {
  position: absolute;
  right: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 2;
}

.stepper-btn {
  width: 18px;
  height: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  padding: 0;
}

.stepper-btn:hover {
  background: var(--accent-coral-light);
  color: var(--accent-coral);
}

body.dark-theme .stepper-btn {
  color: #9CA3AF;
}

body.dark-theme .stepper-btn:hover {
  background: rgba(250, 88, 56, 0.2);
  color: var(--accent-coral);
}

/* --- WEBHOOK & EMBED SETTINGS --- */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 36px 40px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-subtle);
}

.webhook-form-selector {
  max-width: 520px;
  margin-bottom: 24px;
}

.webhook-service-card {
  padding: 24px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: rgba(250, 88, 56, 0.035);
}

.webhook-service-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.webhook-service-heading h3 {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 800;
}

.webhook-status {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.webhook-status.configured {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.24);
}

.webhook-status.missing {
  color: #B45309;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.webhook-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.webhook-subheading {
  margin-top: 28px;
  font-size: 16px;
  font-weight: 800;
}

.generated-fields-panel {
  margin: 4px 0 28px;
  padding: 22px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: rgba(250, 88, 56, 0.04);
}

.generated-fields-panel-end {
  margin-top: 28px;
  margin-bottom: 0;
}

.generated-fields-help {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.generated-fields-code {
  margin: 14px 0;
}

.code-block {
  background: #18181B;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  color: #A7F3D0;
  overflow-x: auto;
  white-space: pre-wrap;
  margin-top: 16px;
}

.info-alert {
  background: rgba(250, 88, 56, 0.08);
  border: 1px solid rgba(250, 88, 56, 0.2);
  border-radius: 16px;
  padding: 18px 24px;
  color: var(--text-dark);
  font-size: 14px;
  margin-bottom: 24px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.embed-preview-wrap {
  margin-top: 28px;
}

.embed-preview {
  display: block;
  width: 100%;
  height: 760px;
  min-height: 500px;
  margin-top: 12px;
  border: 0;
  outline: 0;
  border-radius: 20px;
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: 0 16px 42px rgba(18, 19, 22, 0.14);
}

body.dark-theme .embed-preview {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

/* Public iframe mode: show only the calculator, never dashboard/admin controls. */
html.embed-mode-root {
  background: transparent;
}

html.embed-mode-root,
html.embed-mode-root body {
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

body.embed-mode {
  display: block;
  padding: 0;
  background: var(--bg-card);
}

.embed-mode .dashboard-app {
  display: block;
  max-width: none;
  height: auto;
  min-height: 0;
  overflow: visible;
}

.embed-mode .sidebar-left,
.embed-mode .navbar,
.embed-mode .page-header,
.embed-mode #view-builder,
.embed-mode #view-webhook,
.embed-mode #view-embed {
  display: none !important;
}

.embed-mode .main-content {
  display: block;
  height: auto;
  min-height: 0;
  overflow: visible;
}

.embed-mode .views-scroll-container {
  height: auto;
  min-height: 0;
  overflow: visible;
  padding: 0;
}

.embed-mode #view-calculator {
  display: block !important;
}

.embed-mode .calculator-card {
  margin: 0;
  border: 0;
  box-shadow: none;
}

/* --- MODAL OVERLAY --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px 40px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #F4F4F7;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

body.dark-theme .breakdown-item {
  background: #1E1F24;
}

.breakdown-item.total {
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.3);
  font-weight: 800;
  font-size: 15px;
  color: #16A34A;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #18181B;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 16px;
  border-left: 4px solid var(--accent-coral);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  font-weight: 600;
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* --- RESPONSIVE LAYOUT BREAKPOINTS --- */
@media (max-width: 992px) {
  .services-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  .dashboard-app {
    gap: 14px;
  }

  .sidebar-left {
    width: 52px;
    padding: 14px 0;
    border-radius: 18px;
    top: 16px;
  }

  .sidebar-group {
    gap: 14px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .navbar {
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
  }

  .nav-pill-menu {
    order: 3;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    justify-content: flex-start;
  }

  .user-actions {
    gap: 8px;
  }

  .profile-pill {
    max-width: 180px;
  }

  .lead-form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .service-meta-row {
    grid-template-columns: 1fr;
  }

  .option-builder-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sticky-ticker-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .live-estimate-badge {
    width: 100%;
    text-align: center;
  }

  .embed-mode .calculator-body {
    padding: 24px 20px;
  }
}

@media (max-width: 480px) {
  .brand-logo {
    font-size: 16px;
  }

  .brand-icon {
    width: 30px;
    height: 30px;
  }

  .sidebar-left {
    width: 46px;
    padding: 10px 0;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  body.embed-mode {
    padding: 0;
  }

  .embed-mode .calculator-card {
    border-radius: 16px;
  }
}

/* --- FIREBASE CLOUD SYNC BADGE --- */
.cloud-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #10B981;
  transition: all 0.3s ease;
}

.cloud-sync-badge .sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: pulse-sync 2s infinite ease-in-out;
}

.cloud-sync-badge.syncing {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: #F59E0B;
}

.cloud-sync-badge.syncing .sync-dot {
  background: #F59E0B;
  box-shadow: 0 0 8px #F59E0B;
}

.cloud-sync-badge.offline {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #EF4444;
}

.cloud-sync-badge.offline .sync-dot {
  background: #EF4444;
  box-shadow: 0 0 8px #EF4444;
}

@keyframes pulse-sync {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* --- CLOUDINARY IMAGE UPLOAD & OPTION CARDS --- */
.btn-image-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  height: 40px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px dashed var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  background: var(--bg-dashboard);
  color: var(--text-muted);
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-image-upload:hover {
  border-color: var(--accent-coral);
  color: var(--accent-coral);
  background: var(--accent-coral-light);
}

.btn-image-upload svg {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.btn-image-upload:hover svg {
  color: var(--accent-coral);
}

.option-img-preview-box {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.option-img-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.option-img-delete-btn {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}

.option-card.has-image {
  flex-direction: column;
  padding: 12px;
}

.option-card-media {
  width: 100%;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  background-color: var(--border-color);
  position: relative;
}

.option-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.option-card:hover .option-card-media img {
  transform: scale(1.05);
}
