/* ================================================
   GLOBAL
================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  max-width: 100vw;
  overflow: hidden; /* prevents full-page scroll on desktop */
  overflow-x: hidden;
}

/* Allow scrolling on completion page */
body.completion-page {
  overflow: auto;
}

body.completion-page html {
  overflow: auto;
}

/* ================================================
   HIGH-LEVEL PAGE LAYOUT
================================================ */

.layout {
  display: flex;
  height: 100vh;
  width: 100%;
  background: var(--color-bg-main);
  overflow: hidden;
}

/* ================================================
   SIDEBAR (fixed height, scroll disabled)
================================================ */

.sidebar {
  width: 25%;
  min-width: 320px;
  background: var(--color-bg-sidebar);

  padding: 0 60px 0 36px; /* Less padding on left, more on right to push elements left */

  display: flex;
  flex-direction: column;
  align-items: center; /* Center horizontally */
  justify-content: center; /* Center vertically */

  border-right: 1px solid rgba(0,0,0,0.05);

  height: 100vh;
  overflow: hidden; /* no sidebar scrolling */
}

.sidebar-title {
  font-family: var(--font-family-main);
  font-size: var(--font-size-28);
  font-weight: var(--font-weight-medium);
  color: var(--color-font-primary);
  margin-bottom: 32px;
  line-height: 1.2;
  width: 280px;
  text-align: left; /* Align left */
}

/* ================================================
   SIDEBAR NAV
================================================ */

.sidebar-nav {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 0; /* No bottom margin - dial has its own top margin */
}

.section-pill {
  width: 100%;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-medium-pill);

  font-family: var(--font-family-main);
  font-size: var(--font-size-16);

  display: flex;
  align-items: center;

  background: transparent;
  border: 1px solid var(--color-border-default);
  color: #b0b0b0;

  cursor: default; /* Default cursor */
  transition: all var(--transition-fast);
}

/* Active section (currently working on) */
.section-pill.active {
  border: 2px solid var(--color-border-active);
  color: var(--color-font-muted);
  font-weight: var(--font-weight-medium);
  cursor: pointer; /* Can click to go back to section */
}

.section-pill.active:hover {
  background: rgba(116, 116, 116, 0.05);
}

/* Completed section */
.section-pill.complete {
  background: var(--color-bg-completed);
  border: 2px solid var(--color-brand-teal);
  color: var(--color-font-primary);
  cursor: pointer; /* Can click to navigate back */
}

.section-pill.complete:hover {
  background: rgba(47, 202, 178, 0.08);
}

/* ================================================
   PROGRESS DIAL
================================================ */

.sidebar-progress {
  position: relative;
  width: 280px;
  margin-top: 60px; /* Fixed spacing from pills */
  margin-left: 36px; /* Offset to center with pills */
  padding: 0;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

#progress-dial {
  width: 100%;
  height: auto;
  transform: rotate(0deg);
  margin-bottom: 0;
}

.dial-bg {
  fill: none;
  stroke: #e0e0e0;
  stroke-width: 10px;
  stroke-linecap: round;
}

.dial-progress {
  fill: none;
  stroke: var(--color-brand-teal);
  stroke-width: 10px;
  stroke-linecap: round;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.dial-percent {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);

  font-size: 52px;
  font-weight: var(--font-weight-medium);
  color: var(--color-brand-teal);
  line-height: 1;
  font-family: var(--font-family-main);
}

/* ================================================
   RIGHT CONTENT AREA (NO SCROLL - CENTERED)
================================================ */

.content-area {
  width: 75%;
  height: 100vh;
  overflow: hidden; /* NO scrolling */

  display: flex;
  flex-direction: column;
  align-items: center; /* Center horizontally */
  justify-content: center; /* Center vertically */

  padding: 0 80px; /* Only horizontal padding */
}

/* Form container for centering */
#form-container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.step {
  width: 100%;
  max-width: 760px;
  display: none; /* Hidden by default */
  text-align: left; /* Left-align content */
  animation: fadeIn 0.4s ease-out;
}

.step.active {
  display: block; /* Only active step visible */
}

/* Branch-specific steps hidden until branch selected */
.step.branch-hidden {
  display: none !important; /* Force hide regardless of active state */
}

/* Allow scrolling on estimate step */
#step-estimate.active {
  max-height: 100vh;
  overflow-y: auto;
  padding-bottom: 40px;
}

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

.step-header {
  margin-bottom: 64px; /* Increased from 48px */
}

.step-actions {
  margin-top: 80px; /* Increased from 60px */
  display: flex;
  justify-content: center;
  gap: 24px;
}

/* ================================================
   RESPONSIVE
================================================ */

@media (max-width: 1000px) {

  html, body {
    overflow: hidden;
    max-width: 100vw;
    background: var(--color-bg-main);
  }

  .layout {
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    background: var(--color-bg-main);
  }

  .sidebar {
    display: none;
  }

  .content-area {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-main);
  }

  #form-container {
    width: 100%;
    max-width: 100%;
  }

  .step {
    max-width: 100%;
  }

  .step-header {
    margin-bottom: 32px;
  }

  .step-title {
    font-size: clamp(24px, 7vw, 40px);
  }

  .step-actions {
    margin-top: 32px;
    flex-direction: column-reverse;
  }

  .btn {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .content-area {
    padding: 20px 16px;
  }

  .step-header {
    margin-bottom: 24px;
  }

  .step-actions {
    margin-top: 24px;
  }
}
