/* Contact page - scheduling UI */

.contact-hero{
  padding-top: 11rem;
  padding-bottom: 1.25rem;
  background: linear-gradient(180deg, rgba(0,0,0,.06), rgba(0,0,0,0)), var(--bg);
}

.contact-kicker{
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 .5rem;
}

.contact-title{
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  margin: 0 0 .6rem;
  color: var(--ink);
}

.contact-subtitle{ margin:0; max-width: 75ch; }

.contact-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.cardx{
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

.cardx__title{ margin: 0 0 .35rem; }
.cardx__hint{ margin: 0 0 1rem; color: rgba(0,0,0,.72); }

.sched{ display:grid; gap: 1rem; }
.sched-row{ display:grid; gap: .5rem; }
.sched-label{ font-weight: 800; }

.sched-input{
  width: 100%;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: .75rem;
  padding: .7rem .8rem;
  font: inherit;
  background: rgba(255,255,255,.85);
  outline: none;
}
.sched-input:focus{
  box-shadow: 0 0 0 6px var(--ring);
  border-color: transparent;
}

.hint{ font-size: .92rem; color: rgba(0,0,0,.7); }

.slots{
  display:flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.slots__empty{
  color: rgba(0,0,0,.65);
  padding: .25rem 0;
}
.slot{
  border: 1px solid rgba(0,0,0,.18);
  background: rgba(255,255,255,.85);
  border-radius: .7rem;
  padding: .55rem .7rem;
  font-weight: 800;
  cursor: pointer;
}
.slot[aria-pressed="true"]{
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}
.slot:disabled{
  opacity: .45;
  cursor: not-allowed;
}

.msg{
  margin-top: .5rem;
  font-weight: 800;
  color: rgba(0,0,0,.8);
}
.msg--ok{
  background: rgba(46,125,50,.10);
  border: 1px solid rgba(46,125,50,.22);
  padding: .75rem 1rem;
  border-radius: .9rem;
}

/* Info */
.info-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-top: .5rem;
}
.note{
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,.10);
  color: rgba(0,0,0,.75);
}

/* Modal */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
}

.modal{
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal__panel{
  width: min(860px, 96vw);
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 20px 70px rgba(0,0,0,.35);
  border: 1px solid rgba(0,0,0,.10);
}

.modal__head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  background: rgba(0,0,0,.04);
}

.modal__close{
  border: 0;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  padding: .25rem .4rem;
}

.modal__summary{
  padding: .9rem 1.1rem 0;
  font-weight: 800;
}

.form{
  padding: 1rem 1.1rem 1.1rem;
}

.form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem 1rem;
  margin-top: .75rem;
}

.field{ display:grid; gap: .35rem; }
.field--full{ grid-column: 1 / -1; }

.field input, .field select, .field textarea{
  border: 1px solid rgba(0,0,0,.14);
  border-radius: .75rem;
  padding: .7rem .8rem;
  font: inherit;
  outline: none;
  background: rgba(255,255,255,.95);
}
.field input:focus, .field select:focus, .field textarea:focus{
  box-shadow: 0 0 0 6px var(--ring);
  border-color: transparent;
}

.err{
  min-height: 1em;
  color: #8a1d1d;
  font-weight: 800;
}

.modal__actions{
  display:flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 1rem;
}

@media (max-width: 980px){
  .contact-grid{ grid-template-columns: 1fr; }
  .info-grid{ grid-template-columns: 1fr; }
  .form-grid{ grid-template-columns: 1fr; }
}


/* Ensure hidden attribute actually hides modal + backdrop */
.modal[hidden],
.modal-backdrop[hidden] {
  display: none !important;
}



/* =========================
   Modal: fit in viewport + responsive fields
   ========================= */

/* Keep modal centered, but never overflow the screen */
.modal {
  align-items: center;
  justify-items: center;
  padding: 1rem;
}

/* Make the panel fit the viewport height and scroll internally */
.modal__panel {
  width: min(860px, 96vw);
  max-height: calc(100vh - 2rem);   /* fits on screen */
  display: flex;
  flex-direction: column;
}

/* Header stays visible */
.modal__head {
  flex: 0 0 auto;
}

/* Summary stays visible */
.modal__summary {
  flex: 0 0 auto;
}

/* The form area becomes the scrolling region */
.form {
  flex: 1 1 auto;
  overflow: auto;                   /* scroll inside modal */
  -webkit-overflow-scrolling: touch;
}

/* Make the grid more responsive sooner */
.form-grid {
  grid-template-columns: 1fr 1fr;
}

/* Collapse to single column earlier (tablets/laptops with shorter height) */
@media (max-width: 900px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field--full {
    grid-column: auto;
  }

  .modal__actions {
    justify-content: stretch;
  }

  .modal__actions .btn {
    flex: 1 1 auto;
  }
}

/* Also handle short-height screens (small laptops / zoom) */
@media (max-height: 720px) {
  .modal__panel {
    max-height: calc(100vh - 1rem);
  }
  .form-grid {
    grid-template-columns: 1fr;     /* prevent cramping */
  }
}
