/**
 * Aegis — Tunnel d'inscription
 * Identité visuelle verrouillée :
 *   Polices  : Instrument Serif italic (titres) + DM Sans / Geist (UI)
 *   Palette  : #0e0e0c / #b8924c / #e8d8b0 / #f7f6f3
 *   Style    : marketplace dense — JAMAIS layout aéré "page A4"
 */

/* ── Reset minimal ──────────────────────────────────────────────────────────── */
.aegis-tunnel *,
.aegis-tunnel *::before,
.aegis-tunnel *::after {
  box-sizing: border-box;
}

/* ── Conteneur principal ─────────────────────────────────────────────────────── */
.aegis-tunnel {
  background-color: #f7f6f3;
  font-family: 'DM Sans', 'Geist', Arial, sans-serif;
  color: #0e0e0c;
  padding: 48px 16px 64px;
  min-height: 60vh;
}

.aegis-tunnel__inner {
  max-width: 640px;
  margin: 0 auto;
}

/* ── En-tête du formulaire ───────────────────────────────────────────────────── */
.aegis-tunnel__header {
  margin-bottom: 32px;
}

.aegis-tunnel__title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(32px, 5vw, 44px);
  color: #0e0e0c;
  margin: 0 0 10px;
  line-height: 1.15;
}

.aegis-tunnel__subtitle {
  font-size: 14px;
  color: #555;
  margin: 0;
  line-height: 1.5;
}

/* ── Sections du formulaire ──────────────────────────────────────────────────── */
.aegis-form__section {
  background: #ffffff;
  border: 1px solid #e0ddd6;
  padding: 28px 32px;
  margin-bottom: 16px;
}

.aegis-form__section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #b8924c;
  margin: 0 0 20px;
}

/* ── Grille de champs ────────────────────────────────────────────────────────── */
.aegis-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.aegis-form__grid--full {
  grid-template-columns: 1fr;
}

@media (max-width: 520px) {
  .aegis-form__grid {
    grid-template-columns: 1fr;
  }
  .aegis-form__section {
    padding: 20px 16px;
  }
}

/* ── Champs individuels ──────────────────────────────────────────────────────── */
.aegis-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.aegis-field--full {
  grid-column: 1 / -1;
}

.aegis-field__label {
  font-size: 12px;
  font-weight: 500;
  color: #0e0e0c;
  letter-spacing: 0.3px;
}

.aegis-field__label--required::after {
  content: ' *';
  color: #b8924c;
}

.aegis-field__input,
.aegis-field__select {
  height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(14, 14, 12, 0.2);
  background: #ffffff;
  font-family: 'DM Sans', 'Geist', Arial, sans-serif;
  font-size: 14px;
  color: #0e0e0c;
  outline: none;
  transition: border-color 0.15s;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
}

.aegis-field__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230e0e0c' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.aegis-field__input:focus,
.aegis-field__select:focus {
  border-color: #b8924c;
}

.aegis-field__input.is-error,
.aegis-field__select.is-error {
  border-color: #cc0000;
}

.aegis-field__error {
  font-size: 11px;
  color: #cc0000;
  display: none;
}

.aegis-field__error.is-visible {
  display: block;
}

/* ── Radio civilité ──────────────────────────────────────────────────────────── */
.aegis-radio-group {
  display: flex;
  gap: 16px;
  align-items: center;
  height: 48px;
}

.aegis-radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.aegis-radio-group input[type="radio"] {
  accent-color: #b8924c;
  width: 16px;
  height: 16px;
}

/* ── Toggle Pro ──────────────────────────────────────────────────────────────── */
.aegis-toggle-wrap {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 24px;
  background: #f7f6f3;
  border: 1px solid #e0ddd6;
  margin-bottom: 0;
  cursor: pointer;
}

.aegis-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.aegis-toggle__input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.aegis-toggle__slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  transition: background 0.2s;
  cursor: pointer;
}

.aegis-toggle__slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.aegis-toggle__input:checked + .aegis-toggle__slider {
  background: #b8924c;
}

.aegis-toggle__input:checked + .aegis-toggle__slider::after {
  transform: translateX(20px);
}

.aegis-toggle__label {
  font-size: 14px;
  color: #0e0e0c;
  line-height: 1.4;
}

.aegis-toggle__label strong {
  font-weight: 600;
  color: #b8924c;
}

/* ── Section Pro (masquée par défaut) ────────────────────────────────────────── */
.aegis-pro-section {
  display: none;
  overflow: hidden;
  transition: all 0.25s ease;
}

.aegis-pro-section.is-visible {
  display: block;
}

/* ── Cases à cocher ──────────────────────────────────────────────────────────── */
.aegis-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aegis-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.aegis-checkbox__input {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(14, 14, 12, 0.4);
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}

.aegis-checkbox__input:checked {
  background: #0e0e0c;
  border-color: #0e0e0c;
}

.aegis-checkbox__input:checked::after {
  content: '';
  display: block;
  width: 10px;
  height: 6px;
  border-left: 2px solid #b8924c;
  border-bottom: 2px solid #b8924c;
  transform: rotate(-45deg);
  position: absolute;
  top: 3px;
  left: 3px;
}

.aegis-checkbox__label {
  font-size: 13px;
  color: #333;
  line-height: 1.4;
}

.aegis-checkbox__label a {
  color: #b8924c;
  text-decoration: underline;
}

.aegis-checkbox--required .aegis-checkbox__label::before {
  content: '* ';
  color: #b8924c;
  font-weight: 600;
}

/* ── CTA principal ───────────────────────────────────────────────────────────── */
.aegis-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 40px;
  font-family: 'DM Sans', 'Geist', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  border-radius: 0;
}

.aegis-btn--primary {
  background: #0e0e0c;
  color: #b8924c;
}

.aegis-btn--primary:hover {
  opacity: 0.85;
  color: #b8924c;
}

.aegis-btn--secondary {
  background: transparent;
  color: #0e0e0c;
  border: 1px solid #0e0e0c;
}

.aegis-btn--full {
  width: 100%;
}

.aegis-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Erreurs globales du formulaire ──────────────────────────────────────────── */
.aegis-form__errors {
  background: #fff0f0;
  border: 1px solid #cc0000;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.aegis-form__errors ul {
  margin: 0;
  padding-left: 18px;
}

.aegis-form__errors li {
  font-size: 13px;
  color: #cc0000;
  line-height: 1.6;
}

/* ── Notices (pending, erreur, succès) ───────────────────────────────────────── */
.aegis-notice {
  padding: 32px;
  text-align: center;
  max-width: 540px;
  margin: 48px auto;
  background: #fff;
  border: 1px solid #e0ddd6;
}

.aegis-notice__icon {
  font-size: 36px;
  margin-bottom: 16px;
  display: block;
}

.aegis-notice__title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  color: #0e0e0c;
  margin: 0 0 12px;
}

.aegis-notice__body {
  font-size: 14px;
  color: #444;
  line-height: 1.6;
  margin: 0 0 12px;
}

.aegis-notice__sub {
  font-size: 12px;
  color: #888;
  margin: 0;
}

.aegis-notice__sub a {
  color: #b8924c;
}

.aegis-notice--error {
  border-color: #cc0000;
  background: #fff8f8;
}

.aegis-notice--warning {
  border-color: #e0a000;
}

/* ── Page Mon Compte ─────────────────────────────────────────────────────────── */
.aegis-account {
  background: #f7f6f3;
  padding: 48px 16px 64px;
  font-family: 'DM Sans', 'Geist', Arial, sans-serif;
  color: #0e0e0c;
  min-height: 60vh;
}

.aegis-account__inner {
  max-width: 720px;
  margin: 0 auto;
}

.aegis-account__header {
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.aegis-account__greeting {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 30px;
  color: #0e0e0c;
  margin: 0;
}

.aegis-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.aegis-badge--pro {
  background: #b8924c;
  color: #fff;
}

.aegis-badge--standard {
  background: #0e0e0c;
  color: #e8d8b0;
}

.aegis-card {
  background: #fff;
  border: 1px solid #e0ddd6;
  padding: 24px 28px;
  margin-bottom: 16px;
}

.aegis-card__title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #b8924c;
  margin: 0 0 16px;
}

.aegis-info-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
}

.aegis-info-grid dt {
  font-size: 12px;
  color: #888;
  font-weight: 500;
}

.aegis-info-grid dd {
  font-size: 14px;
  color: #0e0e0c;
  margin: 0;
}

.aegis-info-edit-note {
  margin-top: 16px;
  font-size: 11px;
  color: #aaa;
  font-style: italic;
}

.aegis-advantages-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aegis-advantages-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #0e0e0c;
}

.aegis-advantages-list li::before {
  content: '✓';
  color: #b8924c;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.aegis-account__actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Page Succès ─────────────────────────────────────────────────────────────── */
.aegis-success {
  background: #f7f6f3;
  padding: 64px 16px;
  font-family: 'DM Sans', 'Geist', Arial, sans-serif;
  text-align: center;
  min-height: 60vh;
}

.aegis-success__inner {
  max-width: 520px;
  margin: 0 auto;
}

.aegis-success__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
}

.aegis-success__title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 32px;
  color: #0e0e0c;
  margin: 0 0 12px;
}

.aegis-success__body {
  font-size: 15px;
  color: #444;
  line-height: 1.6;
  margin: 0 0 32px;
}

.aegis-success__ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Spinner de soumission ───────────────────────────────────────────────────── */
.aegis-btn .aegis-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(184, 146, 76, 0.3);
  border-top-color: #b8924c;
  border-radius: 50%;
  animation: aegis-spin 0.7s linear infinite;
  margin-right: 8px;
}

.aegis-btn.is-loading .aegis-spinner {
  display: inline-block;
}

@keyframes aegis-spin {
  to { transform: rotate(360deg); }
}
