/* ==========================================================================
   Toterly Summer / Semester Form (mobile-first)
   Relies on tokens from styles.css: --primary, --primary-hover, --white
   ========================================================================== */

/* --- Layout: columns ----------------------------------------------------- */
.content-columns {
  display: grid;
  grid-template-columns: 1fr;         /* one column by default (phones) */
  gap: 1.25rem;
  align-items: start;
}
.form-container,
.info-container,
.content-columns > * {
  min-width: 0;                        /* critical to prevent horizontal overflow */
}

/* Two columns on larger screens */
@media (min-width: 900px) {
  .content-columns {
    grid-template-columns: minmax(0, 1fr) 340px; /* main + sticky aside */
  }
}

/* --- Cards & shells ------------------------------------------------------ */
.card,
.service-card,
.summary-panel {
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.compact-card { padding: .75rem 1rem; }
.service-card { padding: 1rem 1.1rem; }

/* --- Form controls ------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: .6rem;
}

.form-group label {
  font-size: .9rem;
  font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: .55rem .65rem;
  border: 1px solid #e7e7e7;
  border-radius: 10px;
  font-size: 16px;          /* prevents iOS zoom on focus */
  min-height: 44px;         /* comfortable tap target */
  background: #fff;
  overflow: hidden;
}

select, input, textarea { min-width: 0; }  /* allow shrink inside grid cells */

/* Helper text and validation */
.helper { font-weight: 500; color: #666; margin-left: .25rem; font-size: .85rem; }
.error  { color: #b00020; font-weight: 600; margin-top: .25rem; }
input:invalid, select:invalid { border-color: #ffb4b4; }

/* --- User info grid ------------------------------------------------------ */
.user-grid {
  display: grid;
  grid-template-columns: 1fr;          /* phones: single column */
  gap: .75rem;
}

.user-grid .span-2 { grid-column: 1 / -1; }
.user-grid .span-3 { grid-column: 1 / -1; }
.street { grid-column: 1 / -1; }

.user-grid.two-col { grid-template-columns: 1fr; } /* default mobile */

@media (min-width: 600px) {
  .user-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .user-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .user-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Details (student toggle) ------------------------------------------- */
.compact-details > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: .95rem;
  margin: .25rem 0 .5rem;
  padding: .4rem .25rem;
  border-radius: 8px;
}
.compact-details > summary:focus { outline: 2px solid rgba(0,63,99,.3); }

/* --- Service cards ------------------------------------------------------- */
.form-container .service-cards {
  display: grid;
  gap: 1rem;
}
.service-card h3 { margin: 0 0 .25rem 0; color: var(--primary); }
.rate-note { margin: 0 0 .6rem 0; font-weight: 600; }

/* Two-up row for quantities */
.form-row.tight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
@media (max-width: 420px) {
  .form-row.tight { grid-template-columns: 1fr; } /* stack on very small phones */
}

.checkbox-label.other-items {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: .35rem 0 .5rem 0;
  font-weight: 500;
}

/* Subtotal split line */
.cost-split {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .3rem;
  border-top: 1px dashed #e7e7e7;
  font-weight: 600;
}

/* --- Summary / Estimate panel ------------------------------------------- */
.summary-panel {
  padding: 1rem 1.1rem;
}

/* Stick only on larger screens to avoid mobile overlap */
@media (min-width: 900px) {
  .info-container.sticky .summary-panel {
    position: sticky;
    top: 1rem;
  }
}

.summary-panel h2 {
  margin: 0 0 .5rem 0;
  color: var(--primary);
}

/* Callouts */
.callout{
  background:#e8f4fb;
  border:1px solid #d0e6f5;
  color:#0f3e5d;
  border-radius:10px;
  padding:10px 12px;
  margin:10px 0;
  font-size:.95rem;
  line-height:1.35;
}
.summary-panel .callout{ margin-top:6px; }
.callout-compact{ font-size:.9rem; padding:8px 10px; margin-top:8px; }

/* --- Submit button (+ optional sticky submit bar) ------------------------ */
.submit-btn {
  display: inline-block;
  width: 100%;
  padding: .7rem 1rem;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.submit-btn:hover { background: var(--primary-hover); }

/* Optional: keep submit reachable on long forms (mobile) */
.submit-sticky {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #e7e7e7;
  padding: .6rem;
  z-index: 5;
}

/* --- Small-screen polish ------------------------------------------------- */
@media (max-width: 768px) {
  /* Stack columns */
  .content-columns { grid-template-columns: 1fr; }

  /* Disable sticky on narrow screens */
  .summary-panel { position: static; top: auto; }

  /* Subtle shadow reduction for mobile */
  .card, .service-card, .summary-panel { box-shadow: 0 3px 12px rgba(0,0,0,.05); }
}

/* Prevent accidental horizontal scrolling across the page */
html, body { max-width: 100%; overflow-x: hidden; }

/* Tighter select rendering on very small phones */
@media (max-width: 480px) {
  select { font-size: 16px; } /* keeps iOS from zooming */
}

