/* ========================================
   L'ÉCRIN DE LA ROCHE — Page Invitation
   ======================================== */

/* Layout ----------------------------------------- */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at top, rgba(242, 239, 235, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(75, 14, 22, 0.12) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Header ----------------------------------------- */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-6) var(--space-8);
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--border-subtle);
}

.header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header__lockup {
  height: 48px;
  width: auto;
  color: var(--text-primary);
  display: block;
}

.header__meta {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.6;
}

/* Main ------------------------------------------- */

.main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  position: relative;
  z-index: 1;
}

/* Panel left : invitation / greeting -------------- */

.panel-hero {
  padding: var(--space-16) var(--space-12);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  border-right: 1px solid var(--border-subtle);
}

.panel-hero__eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-8);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.panel-hero__eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--text-muted);
}

.panel-hero__greeting {
  font-size: clamp(2.25rem, 4.5vw, 3.75rem);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-8);
}

.panel-hero__greeting em {
  font-style: italic;
  color: var(--text-muted);
}

.panel-hero__body {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-primary);
  max-width: 46ch;
  margin-bottom: var(--space-8);
}

.panel-hero__body + .panel-hero__body {
  color: var(--text-muted);
}

.panel-hero__event {
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4) var(--space-8);
  max-width: 46ch;
}

.panel-hero__event dt {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding-top: 0.35rem;
}

.panel-hero__event dd {
  font-size: 1rem;
  color: var(--text-primary);
}

/* Panel right : form ----------------------------- */

.panel-form {
  padding: var(--space-16) var(--space-12);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.form__title {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-8);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.form__title::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--text-muted);
}

.form__intro {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-8);
  max-width: 42ch;
}

/* Honeypot - completely hidden from real users */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Form actions row (back + submit) */
.form__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.btn-back {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-3) var(--space-2);
  transition: color 0.2s var(--ease-out);
}

.btn-back:hover {
  color: var(--text-primary);
}

.submit--inline {
  flex: 1;
  margin-top: 0;
}

/* Radio presence --------------------------------- */

.field {
  margin-bottom: var(--space-8);
}

.field__label {
  display: block;
  font-size: 0.95rem;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.field__hint {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-top: var(--space-2);
}

.presence-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.presence-option {
  position: relative;
}

.presence-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.presence-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-4);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  background: transparent;
}

.presence-option label:hover {
  border-color: var(--border-strong);
  background: rgba(242, 239, 235, 0.02);
}

.presence-option input:checked + label {
  background: var(--color-cream);
  color: var(--color-green);
  border-color: var(--color-cream);
}

.presence-option input:focus-visible + label {
  outline: 2px solid var(--color-cream);
  outline-offset: 2px;
}

.presence-option__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid currentColor;
  flex-shrink: 0;
  transition: all 0.25s var(--ease-out);
}

.presence-option input:checked + label .presence-option__dot {
  background: currentColor;
}

/* Text inputs ------------------------------------ */

.input {
  width: 100%;
  padding: var(--space-3) 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 1rem;
  color: var(--text-primary);
  transition: border-color 0.25s var(--ease-out);
}

.input:focus {
  outline: none;
  border-bottom-color: var(--color-cream);
}

.input::placeholder {
  color: var(--text-subtle);
}

/* Number stepper --------------------------------- */

.stepper {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-3) 0;
}

.stepper__btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  color: var(--text-primary);
  transition: all 0.2s var(--ease-out);
  user-select: none;
}

.stepper__btn:hover:not(:disabled) {
  border-color: var(--text-primary);
  background: rgba(242, 239, 235, 0.05);
}

.stepper__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.stepper__value {
  font-size: 1.125rem;
  min-width: 2ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.stepper__label {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Accompanist names ------------------------------ */

.guests-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.guests-list__item {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.guests-list__number {
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
  width: 1.5rem;
  flex-shrink: 0;
  letter-spacing: 0.1em;
}

.guests-list__input {
  flex: 1;
}

/* Conditional reveal ----------------------------- */

.if-coming {
  display: none;
  animation: reveal 0.4s var(--ease-out);
}

.if-coming.is-visible {
  display: block;
}

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

/* Submit ----------------------------------------- */

.submit {
  width: 100%;
  padding: var(--space-6);
  background: var(--color-cream);
  color: var(--color-green);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--color-cream);
  transition: all 0.25s var(--ease-out);
  margin-top: var(--space-4);
}

.submit:hover:not(:disabled) {
  background: transparent;
  color: var(--color-cream);
}

.submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.submit__label-inner {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.submit__arrow {
  transition: transform 0.25s var(--ease-out);
}

.submit:hover:not(:disabled) .submit__arrow {
  transform: translateX(4px);
}

/* Status messages -------------------------------- */

.status {
  margin-top: var(--space-6);
  padding: var(--space-4);
  font-size: 0.875rem;
  border-left: 2px solid var(--accent);
  background: rgba(75, 14, 22, 0.15);
  display: none;
}

.status.is-visible {
  display: block;
}

.status.is-success {
  border-left-color: var(--color-cream);
  background: rgba(242, 239, 235, 0.05);
}

/* Success screen --------------------------------- */

.success-screen {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  animation: reveal 0.6s var(--ease-out);
}

.success-screen__eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.success-screen__eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--text-muted);
}

.success-screen__title {
  font-size: 2.25rem;
  line-height: 1.1;
  margin-bottom: var(--space-6);
  letter-spacing: -0.02em;
}

.success-screen__title em {
  font-style: italic;
  color: var(--text-muted);
}

.success-screen__body {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-8);
}

.success-screen__summary {
  width: 100%;
  padding: var(--space-6);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--space-8);
}

.success-screen__summary dt {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: var(--space-2);
}

.success-screen__summary dd {
  font-size: 1rem;
  margin-bottom: var(--space-4);
}

.success-screen__summary dd:last-child {
  margin-bottom: 0;
}

.success-screen__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-6);
  width: 100%;
}

.calendar-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-cream);
  background: transparent;
  border: 1px solid var(--border-strong);
  transition: all 0.25s var(--ease-out);
}

.calendar-btn:hover {
  background: var(--color-cream);
  color: var(--color-green);
  border-color: var(--color-cream);
}

.success-screen__edit {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--space-1);
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.success-screen__edit:hover {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

/* Footer ----------------------------------------- */

.footer {
  padding: var(--space-6) var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-subtle);
  position: relative;
  z-index: 2;
}

/* Loading state ---------------------------------- */

.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.4s var(--ease-out);
}

.loading-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-screen__logo {
  width: 40px;
  height: 40px;
  color: var(--text-muted);
  animation: pulse 1.8s var(--ease-in-out) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Error page ------------------------------------- */

.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8);
}

.error-page__logo {
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  margin-bottom: var(--space-8);
}

.error-page__title {
  font-size: 2rem;
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}

.error-page__body {
  color: var(--text-muted);
  max-width: 40ch;
  line-height: 1.6;
}

/* Responsive ------------------------------------- */

/* ========================================
   Responsive
   ======================================== */

/* Tablette / petit desktop */
@media (max-width: 900px) {
  .main {
    display: flex;
    flex-direction: column-reverse;
  }

  .panel-form {
    padding: var(--space-12) var(--space-6);
    /* Pas de bordure droite, mais une séparation visuelle dessous */
    border-bottom: 1px solid var(--border-subtle);
  }

  .panel-hero {
    padding: var(--space-12) var(--space-6);
    border-right: none;
  }

  .header {
    padding: var(--space-4) var(--space-6);
  }

  .footer {
    padding: var(--space-4) var(--space-6);
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }

  .panel-hero__greeting {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }

  /* Le greeting prend moins de place sur mobile (moins de scroll inutile dans le form) */
  .panel-hero {
    min-height: auto;
  }
}

/* Mobile portrait */
@media (max-width: 600px) {
  .header {
    padding: var(--space-3) var(--space-4);
  }

  .header__lockup {
    height: 36px;
  }

  .header__meta {
    font-size: 0.65rem;
  }

  .panel-form,
  .panel-hero {
    padding: var(--space-8) var(--space-4);
  }

  .form__intro {
    font-size: 0.9rem;
    margin-bottom: var(--space-6);
  }

  .form__title {
    margin-bottom: var(--space-6);
  }

  .field {
    margin-bottom: var(--space-6);
  }

  .presence-group {
    grid-template-columns: 1fr;
  }

  /* Stepper : sur mobile, le label "personne(s) en plus" passe en dessous */
  .stepper {
    flex-wrap: wrap;
  }

  .stepper__label {
    width: 100%;
    margin-left: 0;
    padding-top: var(--space-2);
    font-size: 0.8rem;
  }

  /* Form actions: full width buttons en colonne */
  .form__actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: var(--space-3);
  }

  .submit--inline {
    width: 100%;
  }

  .btn-back {
    text-align: center;
  }

  /* Success screen : actions empilées et full width */
  .success-screen__actions {
    width: 100%;
  }

  .calendar-btn {
    width: 100%;
    justify-content: center;
  }

  .success-screen__title {
    font-size: 1.75rem;
  }

  .success-screen__edit {
    align-self: center;
  }

  /* Footer compact */
  .footer {
    font-size: 0.65rem;
  }

  /* Event info bloc : compact */
  .panel-hero__event {
    grid-template-columns: 80px 1fr;
    gap: var(--space-3) var(--space-6);
  }

  .panel-hero__event dt {
    font-size: 0.65rem;
  }
}
