/* Global Hero + Quote Form Styles */

/* Define header height variable for pages that don't have it */
:root {
  --header-height: clamp(68px, 10vw, 90px);
  --highlight: #f6e7a4;
  --accent-hover: #ffe9b3;
}

/* Remove legacy top padding from inline styles so hero hugs the header */
main {
  padding-top: 0;
}

.hero {
  /* Pull hero up under header, then push content down with padding */
  margin-top: calc(-1 * var(--header-height));
  padding-top: calc(var(--header-height) + 4rem);
  padding-bottom: 4rem;
  position: relative;
  margin-bottom: 4rem;
  overflow: hidden;
  --hero-gold-gradient: repeating-linear-gradient(
    90deg,
    #fdf7dc 0%,
    #f1d78a 12%,
    #ddb45a 24%,
    #c89338 36%,
    #b97c28 48%,
    #c89338 60%,
    #ddb45a 72%,
    #f1d78a 84%,
    #fdf7dc 100%,
    #f1d78a 112%,
    #ddb45a 124%,
    #c89338 136%,
    #b97c28 148%,
    #c89338 160%,
    #ddb45a 172%,
    #f1d78a 184%,
    #fdf7dc 200%
  );
  --hero-gradient-size: 200%;
}

/* Hero border animation at bottom */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 3px;
  background-image:
    linear-gradient(
      90deg,
      #fdf7dc,
      #f1d78a,
      #ddb45a,
      #c89338,
      #b97c28,
      #c89338,
      #ddb45a,
      #f1d78a,
      #fdf7dc
    ),
    linear-gradient(
      120deg,
      transparent 0%,
      transparent 45%,
      rgba(255, 255, 255, 0.65) 50%,
      transparent 55%,
      transparent 100%
    );
  background-size: 300% 300%, 200% 200%;
  background-position: 0% 50%, -50% 50%;
  animation: borderTravel 6s linear infinite;
  z-index: 10;
}

.hero-bg-container {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0; /* Lowered to ensure it's behind all content */
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1);
  transform-origin: center;
  will-change: opacity, transform;
  animation: heroFadeZoom 20s linear infinite;
}

.hero-slide:nth-child(1) { animation-delay: 0s; }
.hero-slide:nth-child(2) { animation-delay: 4s; }
.hero-slide:nth-child(3) { animation-delay: 8s; }
.hero-slide:nth-child(4) { animation-delay: 12s; }
.hero-slide:nth-child(5) { animation-delay: 16s; }

@keyframes heroFadeZoom {
  0% {
    opacity: 0;
    transform: scale(1);
  }
  5% {
    opacity: 1;
    transform: scale(1.01);
  }
  18% {
    opacity: 1;
    transform: scale(1.08);
  }
  20% {
    opacity: 0;
    transform: scale(1.1);
  }
  100% {
    opacity: 0;
    transform: scale(1.1);
  }
}

@keyframes auroraFlow {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: -100% 0%;
  }
}

.hero-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0; /* Lowered from 2 to keep overlay BEHIND all content */
  background: rgba(11, 11, 13, 0.7);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5rem;
  align-items: start; /* Changed from center to start - prevents form from affecting hero height */
  max-height: 100%; /* Constrain content to hero bounds */
}

.hero-copy {
  text-align: center;
}

.hero-copy h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
  background: var(--hero-gold-gradient, var(--gold-gradient));
  background-size: 200% 200%;
  background-position: 0% 0%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  animation: heroAuroraFlow 8s linear infinite;
  text-shadow: 0 0 25px rgba(242, 182, 50, 0.35), 0 0 45px rgba(242, 182, 50, 0.25);
}

.hero-copy h1,
.hero .quote-box h2,
.hero .form-step h3,
.hero .quote-box button {
  background-size: var(--hero-gradient-size, 200%) var(--hero-gradient-size, 200%);
  background-position: 50% 50%;
}

.hero-copy p {
  color: var(--muted);
  max-width: 32rem;
  font-size: 1.05rem;
  margin: 0 auto;
}

.quote-box {
  background: var(--panel-dark);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  isolation: isolate;
}

.quote-box::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background-image:
    linear-gradient(
      90deg,
      #fdf7dc,
      #f1d78a,
      #ddb45a,
      #c89338,
      #b97c28,
      #c89338,
      #ddb45a,
      #f1d78a,
      #fdf7dc
    ),
    linear-gradient(
      120deg,
      transparent 0%,
      transparent 45%,
      rgba(255, 255, 255, 0.65) 50%,
      transparent 55%,
      transparent 100%
    );
  background-size: 300% 300%, 200% 200%;
  background-position: 0% 50%, -50% 50%;
  animation: borderTravel 6s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

.quote-box h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  text-align: center;
}

.hero .quote-box h2 {
  position: relative;
  display: inline-block;
  background: var(--hero-gold-gradient, var(--gold-gradient));
  background-size: 200% 200%;
  background-position: 0% 0%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  animation: heroAuroraFlow 8s linear infinite;
  text-shadow: 0 0 25px rgba(242, 182, 50, 0.35), 0 0 45px rgba(242, 182, 50, 0.25);
}

.hero .form-step h3 {
  display: block;
  width: 100%;
  text-align: center;
  font-family: "Audiowide", "Times New Roman", Times, serif;
  font-weight: 700;
  background: var(--hero-gold-gradient, var(--gold-gradient));
  background-size: 200% 200%;
  background-position: 0% 0%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  animation: heroAuroraFlow 8s linear infinite;
  text-shadow: 0 0 25px rgba(242, 182, 50, 0.35), 0 0 45px rgba(242, 182, 50, 0.25);
}

.quote-box form {
  display: block; /* Changed from grid to block for natural sizing */
}

.quote-box label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--highlight);
}

.quote-box input,
.quote-box select,
.quote-box button {
  width: 100%;
  padding: 0.85rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 15, 20, 0.8);
  color: var(--text-light);
  font-size: 0.95rem;
  transition: border-color var(--transition), background var(--transition), transform 0.2s ease;
}

.quote-box input:focus,
.quote-box select:focus {
  outline: none;
  border-color: var(--accent-hover);
  background: rgba(20, 20, 28, 0.95);
}

#available-date {
  padding-right: 3rem;
}

#available-date::-webkit-calendar-picker-indicator {
  width: 1.8rem;
  height: 1.8rem;
  background: url("../svg/calendar-arrow-up-svgrepo-com.svg") center / contain no-repeat;
  filter: brightness(0) saturate(100%) invert(90%) sepia(38%) saturate(450%) hue-rotate(358deg) brightness(105%) contrast(95%);
  cursor: pointer;
  margin-right: -0.6rem;
  transform: translateX(0.45rem);
}

.quote-box button {
  background: #d4a338;
  color: #0b0b0d;
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid #d4a338;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quote-box button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.quote-box .btn-next,
.quote-box #submit-btn,
.quote-box #qa-modal-add-btn {
  background: #d4a338;
  border-color: #d4a338;
  color: #0b0b0d;
}

.quote-box .btn-secondary,
.quote-box .btn-back,
.quote-box #qa-modal-cancel {
  background: #2f3440;
  border: 1px solid #4f5a70;
  color: #f5f5f5;
  animation: none;
}

.quote-box .btn-secondary:hover,
.quote-box .btn-back:hover,
.quote-box #qa-modal-cancel:hover {
  filter: brightness(1.12);
  border-color: #6d7a96;
}

.progress-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem; /* Reduced from 3rem for tighter layout */
  position: relative;
}

.progress-indicator::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(242, 182, 50, 0.2);
  z-index: 0;
}

.progress-step {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}

.progress-step-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #2f3440;
  border: 2px solid #4f5a70;
  margin: 0 auto 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Audiowide", "Times New Roman", Times, serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #f5f5f5;
  box-shadow: none;
}

.progress-step-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.3s ease;
}

.progress-step.active .progress-step-circle {
  background: #d4a338;
  color: #0b0b0d;
  border-color: #d4a338;
  filter: none;
  transform: translateY(-2px);
  animation: none;
}

.quote-modal-close {
  display: none !important;
}

.progress-step.active .progress-step-label,
.progress-step.completed .progress-step-label {
  color: var(--highlight);
}

.progress-step.completed .progress-step-circle {
  background: #a98330;
  color: #0b0b0d;
  border-color: #a98330;
  filter: none;
  transform: none;
  animation: none;
}

.form-step {
  display: none;
  animation: fadeIn 0.3s ease;
}

.form-step.active {
  display: block;
}

.form-step[data-step="2"] {
  min-height: 27rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-step h3 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.form-step-content {
  display: grid;
  gap: 1.5rem; /* Increased from 1rem for better spacing between fields */
}

.form-step-content > div {
  display: flex;
  flex-direction: column;
  gap: 0.5rem; /* Space between label and input within each field */
}

.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.button-group.single {
  grid-template-columns: 1fr;
}

.button-group button {
  transition: transform 0.2s ease;
}

.button-group button:hover {
  transform: translateY(-2px);
}

/* Back button styling */
.btn-secondary {
  background: #2f3440;
  border: 1px solid #4f5a70;
  color: #f5f5f5;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

#btn-add-vehicle {
  width: 100%;
  margin-top: 1rem;
  padding: 0.85rem;
  border-radius: 0.6rem;
  border: 1px solid #d4a338;
  background: #d4a338;
  color: #0b0b0d;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  animation: none;
}

#btn-add-vehicle:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.qa-veh-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.qa-veh-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(242, 182, 50, 0.3);
  border-radius: 0.6rem;
  background: rgba(15, 15, 20, 0.65);
}

.qa-veh-label {
  font-size: 0.95rem;
  color: var(--text-light);
}

.qa-veh-remove {
  width: 36px !important;
  min-width: 36px;
  height: 36px;
  padding: 0 !important;
  position: relative;
  border-radius: 0.45rem !important;
  border: 1px solid rgba(220, 53, 69, 0.6) !important;
  background: rgba(220, 53, 69, 0.22) !important;
  color: transparent !important;
  line-height: 1;
  font-size: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: none;
}

.qa-veh-remove::before {
  content: "";
  width: 15px;
  height: 15px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: url("../svg/x-symbol-svgrepo-com.svg") center / contain no-repeat;
  filter: brightness(0) saturate(100%) invert(94%) sepia(20%) saturate(325%) hue-rotate(304deg) brightness(105%) contrast(101%);
}

.qa-veh-remove:hover {
  background: rgba(220, 53, 69, 0.35) !important;
  border-color: rgba(220, 53, 69, 0.9) !important;
}

.qa-veh-add-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.qa-veh-add-row #btn-add-vehicle {
  width: auto;
  margin-top: 0;
  padding: 0.7rem 1.1rem;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

.qa-modal-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
  background: rgba(5, 5, 8, 0.82);
  z-index: 25;
}

.qa-modal-box {
  width: min(100%, 480px);
  max-height: calc(100% - 1.7rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.85rem;
  background: linear-gradient(160deg, rgba(242, 182, 50, 0.16), rgba(8, 8, 10, 0.96));
  border: 1px solid rgba(242, 182, 50, 0.45);
  padding: 1.35rem;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
}

.qa-modal-title {
  font-size: 1.2rem;
  color: var(--highlight);
  margin-bottom: 1rem;
}

.qa-modal-fields {
  gap: 0.85rem;
}

.qa-modal-actions {
  margin-top: 1.2rem;
}

.qa-radio-row {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.5rem;
  align-items: center;
}

.qa-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-light);
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: 0;
  font-family: "Times New Roman", Times, serif;
}

.qa-radio-label input[type="radio"] {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  accent-color: #d4a338;
}

@media (max-width: 900px) {
  .hero {
    padding-top: calc(var(--header-height) + 3rem);
    margin-bottom: 2.5rem;
    overflow: visible; /* Allow content to be accessible */
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    max-height: 100%; /* Keep content constrained to hero bounds */
    align-items: start;
    overflow: visible; /* Allow quote box to be scrollable if needed */
  }

  .hero-copy {
    text-align: center;
  }

  .hero-slide {
    background-position: center 60%;
  }

  .hero-overlay {
    background: rgba(11, 11, 13, 0.75);
  }

  .hero-copy h1 {
    font-size: clamp(1.9rem, 6vw, 2.5rem);
    padding: 0 1.25rem;
    line-height: 1.2;
  }

  .hero-copy p {
    padding: 0 1.25rem;
    font-size: 1rem;
    margin: 0 auto;
  }

  .quote-box {
    padding: 1.5rem;
  }
}

@media (max-width: 600px) {
  .quote-box {
    padding: 1.25rem;
  }

  .quote-box h2 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
  }

  .progress-indicator {
    margin-bottom: 1.5rem;
  }

  .progress-step-circle {
    width: 32px; /* Reduced from 40px for 4 steps */
    height: 32px;
    font-size: 0.9rem;
  }

  .progress-step-label {
    font-size: 0.7rem; /* Reduced from 0.85rem */
  }

  .form-step h3 {
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
  }

  .form-step-content {
    gap: 1.25rem; /* Slightly tighter on very small screens */
  }

  .button-group {
    grid-template-columns: 1fr;
    margin-top: 1.5rem; /* Reduced from 2rem */
  }

  .form-step[data-step="2"] {
    min-height: 21rem;
  }

  .qa-veh-add-row {
    flex-direction: column;
    align-items: stretch;
  }

  .qa-veh-add-row #btn-add-vehicle {
    width: 100%;
  }

  .qa-modal-overlay {
    align-items: flex-start;
    padding-top: 1rem;
  }

  .qa-modal-box {
    max-height: calc(100% - 1rem);
  }
}

@keyframes heroAuroraFlow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: -200% 50%;
  }
}

/* Quote Modal Styles */
.quote-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  pointer-events: none !important;
  touch-action: none;
}

body.quote-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body.quote-modal-open .quote-modal-overlay {
  opacity: 1;
  visibility: visible;
}

/* Remove blur on touch devices to prevent compositor hit-test issues */
@media (hover: none), (pointer: coarse) {
  .quote-modal-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(5, 5, 8, 0.9);
  }
}

body.quote-modal-open header,
body.quote-modal-open main,
body.quote-modal-open footer {
  pointer-events: none;
}

body.quote-modal-open .quote-box {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  width: min(92%, 520px) !important;
  height: auto !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  z-index: 2000 !important;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6) !important;
  padding: 3.25rem 2.25rem 2.25rem !important;
  pointer-events: auto !important;
  touch-action: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0 !important;
}

body.quote-modal-open .quote-box * {
  pointer-events: auto;
}

.quote-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.8);
  width: 36px;
  height: 36px;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7));
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  z-index: 2100;
}

.quote-modal-close:hover {
  background: linear-gradient(120deg, rgba(253, 247, 220, 0.3), rgba(200, 147, 56, 0.65));
  border-color: rgba(255, 255, 255, 0.45);
}

body.quote-modal-open .quote-modal-close {
  display: inline-flex;
}
