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

:root {
  --primary: #2d6a4f;
  --primary-dark: #1b4332;
  --primary-light: #52b788;
  --accent: #d4a373;
  --bg: #fefae0;
  --bg-card: #ffffff;
  --text: #2b2b2b;
  --text-light: #6b705c;
  --border: #ddd;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-align: center;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--accent); color: #fff; }
.btn-secondary:hover { background: #c08b5c; color: #fff; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.btn-lg { padding: 0.8rem 2rem; font-size: 1.1rem; }
.btn-success { background: #2d6a4f; color: #fff; }
.btn-danger { background: #c1121f; color: #fff; }

/* ── Nav ── */
.nav {
  background: var(--primary-dark);
  color: #fff;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-brand { color: #fff; font-size: 1.3rem; font-weight: 700; }
.nav-brand:hover { color: var(--primary-light); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}
.nav-links { display: flex; align-items: center; gap: 1.2rem; }
.nav-links a { color: #fff; font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary-light); }
.nav-user { display: flex; align-items: center; gap: 0.5rem; }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0; right: 0;
    background: var(--primary-dark);
    padding: 1rem;
    gap: 0.8rem;
  }
  .nav-links.open { display: flex; }
}

/* ── Hero ── */
.hero {
  position: relative;
  color: #fff;
  text-align: center;
  padding: 6rem 1.5rem;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-dark);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.hero-overlay {
  display: none; /* replaced by card below */
}
.hero-content {
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border-radius: 12px;
  padding: 2.5rem 3rem;
  margin: 1.5rem;
  max-width: 680px;
  width: 100%;
}
.hero-content h1 { font-size: 2.8rem; margin-bottom: 0.6rem; text-shadow: 0 2px 12px rgba(0,0,0,0.5); }
.hero-sub { font-size: 1.2rem; opacity: 0.92; margin-bottom: 1.8rem; text-shadow: 0 1px 6px rgba(0,0,0,0.4); }

@media (max-width: 768px) {
  .hero { padding: 3rem 1rem; min-height: 50vh; }
  .hero-content { padding: 1.75rem 1.5rem; margin: 1rem; }
  .hero-content h1 { font-size: 2rem; }
  .about-content { padding: 1.75rem 1.5rem; }
  .service-box-content { width: calc(100% - 2rem); max-width: 100%; min-height: 0; padding: 1.5rem 1.25rem; }
}

/* ── Road Divider (themed) ── */
.road-divider { height: 0; }

/* ── Services (Dual Boxes) ── */
.services {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
}
.service-box {
  position: relative;
  padding: 0;
  text-align: center;
  background-color: var(--primary-dark);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  overflow: hidden;
}
.service-box-overlay {
  display: none;
}
/* Both content cards are the same fixed size — left has whitespace, right has the calc */
.service-box-content {
  position: relative;
  z-index: 2;
  width: calc(100% - 4rem);
  max-width: 380px;
  min-height: 520px;
  margin: 0;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  transition: background 0.3s ease;
  box-sizing: border-box;
}
.service-box:hover .service-box-content {
  background: rgba(0, 0, 0, 0.44);
}
.service-box h2 {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.service-box p {
  color: rgba(255,255,255,0.88);
  margin-bottom: 1.5rem;
  max-width: 340px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

@media (max-width: 768px) {
  .services { grid-template-columns: 1fr; }
  .service-box { min-height: 55vh; }
}

/* ── About ── */
.about {
  position: relative;
  text-align: center;
  padding: 5rem 1.5rem;
  background-color: var(--primary-dark);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.about-overlay {
  display: none; /* replaced by card below */
}
.about-content {
  position: relative;
  z-index: 2;
  max-width: 660px;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border-radius: 12px;
  padding: 2.5rem 3rem;
}
.about h2 { margin-bottom: 1rem; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.about p { color: rgba(255,255,255,0.88); text-shadow: 0 1px 4px rgba(0,0,0,0.3); }

/* ── Calendar ── */
.calendar-page {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.calendar-page h1 { margin-bottom: 0.5rem; }
.calendar-subtitle { color: var(--text-light); margin-bottom: 1.5rem; }

.calendar-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 0.4rem 1rem;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.9rem;
}
.filter-btn.active {
  background: var(--primary);
  color: #fff;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.calendar-nav h2 { font-size: 1.2rem; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2rem;
}
.cal-header { font-weight: 700; text-align: center; padding: 0.5rem; font-size: 0.8rem; color: var(--text-light); }
.cal-day {
  min-height: 60px;
  border: 1px solid var(--border);
  padding: 0.3rem;
  font-size: 0.85rem;
  background: var(--bg-card);
  cursor: default;
  position: relative;
}
.cal-day.empty { background: transparent; border: none; }
.cal-day.has-slots { cursor: pointer; border-color: var(--primary-light); }
.cal-day.has-slots:hover { background: #e8f5e9; }
.cal-day .day-num { font-weight: 600; }
.cal-day .slot-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin: 1px;
}
.slot-dot.mobile { background: var(--primary); }
.slot-dot.roof { background: var(--accent); }

.slot-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
  box-shadow: var(--shadow);
}
.slot-panel h3 { margin-bottom: 1rem; }
.slot-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.slot-item:last-child { border-bottom: none; }
.slot-info { display: flex; flex-direction: column; gap: 0.2rem; }
.slot-type { font-weight: 600; }
.slot-time { color: var(--text-light); font-size: 0.9rem; }
.slot-location { color: var(--primary); font-size: 0.85rem; }

/* ── Booking Form ── */
.booking-form-page {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.booking-slot-info {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
}
.booking-form h3 { margin: 1.5rem 0 0.8rem; color: var(--primary-dark); }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-weight: 500; font-size: 0.9rem; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.15);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }
.form-note { margin-top: 1rem; font-size: 0.85rem; color: var(--text-light); }

/* ── Booking Confirmation ── */
.booking-confirmation {
  max-width: 600px;
  margin: 3rem auto;
  padding: 0 1rem;
  text-align: center;
}
.confirmation-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
}
.confirmation-icon { font-size: 3rem; margin-bottom: 1rem; }
.confirmation-details { margin: 1.5rem 0; text-align: left; }
.confirmation-card ol { text-align: left; margin: 1rem 0 1.5rem 1.2rem; }
.confirmation-card li { margin-bottom: 0.5rem; }

/* ── Error Pages ── */
.error-page { text-align: center; padding: 4rem 1rem; }
.error-page h1 { font-size: 3rem; color: var(--primary-dark); margin-bottom: 1rem; }

/* ── Footer ── */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  font-size: 0.9rem;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-pending { background: #ffd166; color: #333; }
.badge-confirmed { background: #06d6a0; color: #fff; }
.badge-completed { background: #118ab2; color: #fff; }
.badge-cancelled { background: #ef476f; color: #fff; }
.badge-admin { background: var(--primary); color: #fff; }
.badge-user { background: var(--text-light); color: #fff; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--primary-dark); color: #fff; font-weight: 600; }
.table-avatar { width: 32px; height: 32px; border-radius: 50%; }
.input-sm { padding: 0.3rem 0.5rem; font-size: 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); margin-right: 0.3rem; }
.actions-cell { white-space: nowrap; }
.actions-cell form { display: inline-block; margin: 2px; }

/* ══════════════════════════════════════════════════════
   ROOF COST CALCULATOR
   ══════════════════════════════════════════════════════ */

.roof-calc-wrapper {
  margin-top: 1rem;
  width: 100%;
}

.calc-widget {
  background: transparent;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.15);
  border-radius: 0;
  padding: 1rem 0 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  width: 100%;
}

.calc-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: #fff;
}

.calc-inputs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.calc-field {
  flex: 1;
  min-width: 110px;
}

.calc-field label {
  display: block;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.calc-field input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius, 4px);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.95rem;
  box-sizing: border-box;
}
.calc-field input::placeholder { color: rgba(255,255,255,0.45); }

.calc-field input:focus {
  outline: none;
  border-color: var(--primary, #2d6a4f);
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.15);
}

.calc-unit {
  color: var(--text-light, #999);
  font-weight: 400;
}

/* Add-ons */
.calc-addons {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calc-addon-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
}

.calc-addon-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--primary, #2d6a4f);
  cursor: pointer;
}

.calc-addon-row input[type="number"] {
  width: 60px;
  padding: 0.3rem 0.4rem;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius, 4px);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.calc-addon-row label {
  cursor: pointer;
  color: rgba(255,255,255,0.88);
}

.calc-addon-cost {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
}

/* Result box */
.calc-result {
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius, 6px);
  padding: 1rem;
  margin-top: 0.25rem;
  animation: calcFadeIn 0.2s ease;
}

@keyframes calcFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.calc-breakdown {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.calc-total {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}

.calc-total-num {
  color: var(--primary, #2d6a4f);
  font-size: 1.3rem;
}

.calc-note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  margin: 0 0 0.75rem;
  font-style: italic;
}

.calc-cta {
  display: inline-block;
  margin-top: 0.25rem;
  width: 100%;
  text-align: center;
}

/* ══════════════════════════════════════════════════════
   ESTIMATE BANNER — Calendar page
   ══════════════════════════════════════════════════════ */

.estimate-banner {
  background: var(--bg-card, #fff);
  border: 2px solid var(--primary, #2d6a4f);
  border-radius: var(--radius, 6px);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.estimate-banner-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.estimate-label {
  font-size: 0.8rem;
  color: var(--text-light, #666);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.estimate-amount {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary, #2d6a4f);
}

.estimate-detail {
  font-size: 0.85rem;
  color: var(--text-light, #666);
}

.estimate-edit {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--accent, #d4a373);
  text-decoration: none;
  white-space: nowrap;
}

.estimate-edit:hover {
  text-decoration: underline;
}

.estimate-note {
  font-size: 0.75rem;
  color: var(--text-light, #999);
  margin: 0.4rem 0 0;
  font-style: italic;
}
