/* =========================================================================
   Living Convinced — Forms + Modals v7.2.0
   Extensions to the existing modal styles for the four wired flows.
   ========================================================================= */

/* Modal panel sizing — a touch wider to accommodate cohort gating */
.lc-modal .modal__panel {
  max-width: 640px;
}

/* Cohort session banner — displays fixed session dates */
.lc-modal__session {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
  background: rgba(181, 94, 7, 0.08);
  border-left: 3px solid var(--color-gold);
  border-radius: 4px;
  font-family: var(--font-body);
}
.lc-modal__session-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold-light);
}
.lc-modal__session-value {
  font-size: 1rem;
  color: var(--color-text);
  font-weight: 500;
}

/* Fieldset for radio groups */
.lc-form__fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.lc-form__legend {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  padding: 0;
  letter-spacing: 0.01em;
}

/* Radio option cards */
.lc-form__radio {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(230, 228, 225, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease;
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.45;
}
.lc-form__radio:hover {
  border-color: rgba(181, 94, 7, 0.5);
  background: rgba(181, 94, 7, 0.03);
}
.lc-form__radio input[type="radio"] {
  margin-top: 0.35rem;
  accent-color: var(--color-gold);
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}
.lc-form__radio input[type="radio"]:checked ~ span {
  color: var(--color-text);
}
.lc-form__radio:has(input[type="radio"]:checked) {
  border-color: var(--color-gold);
  background: rgba(181, 94, 7, 0.06);
}
.lc-form__radio span {
  flex: 1;
  font-size: 0.95rem;
}
.lc-form__radio strong {
  display: block;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.15rem;
}
.lc-form__radio-note {
  display: block;
  font-size: 0.82rem;
  color: rgba(230, 228, 225, 0.65);
  font-weight: 400;
  line-height: 1.4;
}

/* Inline checkbox row (Facilitator certification acknowledgment) */
.lc-form__field--check {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(230, 228, 225, 0.12);
  border-radius: 6px;
  background: rgba(230, 228, 225, 0.03);
  margin-bottom: 1rem;
}
.lc-form__field--check input[type="checkbox"] {
  margin-top: 0.15rem;
  accent-color: var(--color-gold);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.lc-form__label--inline {
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(230, 228, 225, 0.85);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

/* Cohort gate message: "no book yet" branch */
.lc-modal__gate-message {
  padding: 1.25rem 1.35rem;
  border-left: 3px solid var(--color-gold);
  background: rgba(181, 94, 7, 0.06);
  border-radius: 4px;
  margin-bottom: 1.25rem;
}
.lc-modal__gate-lede {
  font-family: var(--font-body);
  color: rgba(230, 228, 225, 0.88);
  line-height: 1.55;
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
}
.lc-modal__gate-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.lc-modal__gate-actions .cta-btn {
  flex: 1 1 auto;
  min-width: 200px;
  padding: 0.7rem 1.1rem;
  font-size: 0.85rem;
}

/* Fee note (below format radios) */
.lc-modal__fee-note {
  font-family: var(--font-body);
  color: var(--color-gold-light);
  font-size: 0.85rem;
  line-height: 1.45;
  margin: -0.5rem 0 1.25rem 0;
  min-height: 1.2rem;
  font-style: italic;
}

/* Loading state */
.lc-modal__state--loading {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.lc-modal__loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  color: var(--color-gold);
}
.lc-modal__spinner {
  width: 48px;
  height: 48px;
  animation: lc-spin 1.1s linear infinite;
}
.lc-modal__loading-text {
  font-family: var(--font-body);
  color: var(--color-text);
  font-size: 1rem;
  text-align: center;
  max-width: 320px;
  line-height: 1.4;
}
@keyframes lc-spin {
  to { transform: rotate(360deg); }
}

/* Error state buttons stack */
.lc-modal__state--error {
  text-align: left;
}
.lc-modal__state--error .cta-btn {
  margin-right: 0.5rem;
  margin-top: 0.75rem;
}
.lc-modal__error-link {
  color: var(--color-gold-light);
  text-decoration: underline;
}

/* Two-up row (matches existing lc-form__row but ensures stack on mobile) */
.lc-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  .lc-form__row {
    grid-template-columns: 1fr;
  }
  .lc-modal__gate-actions .cta-btn {
    width: 100%;
    min-width: 0;
  }
}

/* Ensure select styling matches inputs (some browsers default weird) */
.lc-modal select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--color-gold-light) 50%),
                    linear-gradient(135deg, var(--color-gold-light) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}

/* Tighten spacing above submit button */
.lc-modal__submit {
  margin-top: 0.5rem;
  width: 100%;
}

/* Force [hidden] to win over button display rules (fixes Branch E submit visibility) */
.lc-modal [hidden] {
  display: none !important;
}

/* Modal eyebrow spacing on mobile — prevent crowding against the close button */
.lc-modal .modal__eyebrow {
  padding-right: 2.5rem;
}
@media (max-width: 640px) {
  .lc-modal .modal__panel {
    padding-top: 3.5rem;
  }
  .lc-modal .modal__eyebrow {
    padding-right: 0;
    margin-top: 0.75rem;
  }
  .lc-modal .modal__close {
    top: 0.65rem;
    right: 0.75rem;
  }
  .lc-modal__session {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.75rem 0.9rem;
  }
}

/* Prevent body scroll when modal open */
body.modal-open {
  overflow: hidden;
}
