/* ═══════════════════════════════════════════════════
   POLYZEA · prof.css
   Même système de design que dashboard / index
   Palette : #FFFDF8 | #14B8A6 | #84CC16 | #FB923C
   Texte   : #1F2937 | #6B7280
═══════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────── */
:root {
  --bg:           #FFFDF8;
  --primary:      #14B8A6;
  --primary-deep: #0EA5A4;
  --primary-10:   rgba(20,184,166,0.10);
  --primary-05:   rgba(20,184,166,0.05);
  --accent:       #84CC16;
  --accent-10:    rgba(132,204,22,0.12);
  --orange:       #FB923C;
  --orange-10:    rgba(251,146,60,0.12);
  --text:         #1F2937;
  --text-sec:     #6B7280;
  --text-light:   #9CA3AF;
  --white:        #FFFFFF;
  --border:       rgba(20,184,166,0.14);
  --shadow-sm:    0 2px 12px rgba(20,184,166,0.07);
  --shadow-md:    0 8px 32px rgba(20,184,166,0.12);
  --shadow-lg:    0 20px 60px rgba(20,184,166,0.16);
  --shadow-btn:   0 4px 24px rgba(20,184,166,0.30);
  --radius-sm:    14px;
  --radius-md:    22px;
  --radius-lg:    32px;
  --radius-xl:    48px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ── Fond hexagones ────────────────────────────────── */
.hex-bg {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0; opacity: 0.8;
}
.bg-orbs {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.65;
}
.orb--teal {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(20,184,166,0.15) 0%, transparent 70%);
  top: -150px; right: -80px;
}
.orb--green {
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(132,204,22,0.11) 0%, transparent 70%);
  bottom: 40px; left: -90px;
}
.orb--orange {
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(251,146,60,0.10) 0%, transparent 70%);
  bottom: 30%; right: 8%;
}

/* ═══════════════════════════════════════════════════
   PAGE LAYOUT
═══════════════════════════════════════════════════ */
.page {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  gap: 1.2rem;
}

/* Lien retour */
.back-link {
  position: fixed; top: 1.2rem; left: 1.5rem;
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; font-weight: 500; color: var(--text-sec);
  background: rgba(255,253,248,0.88);
  border: 1px solid var(--border);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
  z-index: 50;
}
.back-link:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-05); }

/* ═══════════════════════════════════════════════════
   AUTH CARD
═══════════════════════════════════════════════════ */
.auth-card {
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.4rem 2.2rem 2rem;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: card-in 0.55s cubic-bezier(0.34,1.1,0.64,1) both;
}

@keyframes card-in {
  from { opacity:0; transform: translateY(24px) scale(0.97); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

/* Logo dans la carte */
.auth-card__logo {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.3rem; margin-bottom: 1.8rem;
}
.auth-card__brand {
  font-family: var(--font-display);
  font-size: 1.9rem; font-weight: 900; color: var(--primary);
}
.auth-card__role {
  font-size: 0.8rem; font-weight: 500; color: var(--text-sec);
  letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--primary-05);
  padding: 0.22rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--border);
}

/* ── Formulaires auth ──────────────────────────────── */
.auth-form {
  display: flex; flex-direction: column; gap: 1rem;
}
.auth-form__title {
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 700; color: var(--text);
  text-align: center; margin-bottom: 0.3rem;
}

.auth-divider {
  display: flex; align-items: center; gap: 0.8rem;
  color: var(--text-light); font-size: 0.78rem;
}
.auth-divider::before,
.auth-divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border);
}

.auth-switch {
  text-align: center; font-size: 0.82rem; color: var(--text-sec);
}
.auth-switch a { color: var(--primary); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* ── Bouton Google ─────────────────────────────────── */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 0.65rem;
  padding: 0.78rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.9);
  font-size: 0.9rem; font-weight: 500; color: var(--text);
  transition: all 0.2s;
}
.btn-google:hover {
  border-color: rgba(20,184,166,0.35);
  background: rgba(255,255,255,1);
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════
   FORM ELEMENTS communs
═══════════════════════════════════════════════════ */
.form-group {
  display: flex; flex-direction: column; gap: 0.38rem;
}
.form-group label {
  font-size: 0.83rem; font-weight: 600; color: var(--text);
}
.form-group small { color: var(--text-sec); font-weight: 400; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.72rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.88);
  font-family: var(--font-body); font-size: 0.92rem; color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20,184,166,0.12);
}

.form-row { display: flex; gap: 1rem; }
.half { flex: 1; }

/* ── Boutons ────────────────────────────────────────── */
.btn-primary {
  background: var(--primary); color: white; border: none;
  padding: 0.82rem 1.6rem; border-radius: 999px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.92rem;
  cursor: pointer; transition: all 0.22s;
  box-shadow: var(--shadow-btn);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-primary:hover { background: var(--primary-deep); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(20,184,166,0.35); }
.btn-primary:active { transform: translateY(0); }
.btn--full { width: 100%; }

.btn-secondary {
  background: transparent; border: 1.5px solid var(--border);
  color: var(--text-sec); padding: 0.82rem 1.4rem;
  border-radius: 999px; font-family: var(--font-body); font-weight: 600; font-size: 0.88rem;
  cursor: pointer; transition: all 0.22s;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-05); }

/* ═══════════════════════════════════════════════════
   MODAL PROFIL
═══════════════════════════════════════════════════ */
.modal {
  position: fixed; inset: 0;
  background: rgba(31,41,55,0.45);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-content {
  background: var(--bg);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(20,184,166,0.18);
  padding: 2.2rem 2.5rem 2.5rem;
  width: 100%; max-width: 760px;
  margin: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.35s cubic-bezier(0.34,1.15,0.64,1) both;
}

@keyframes modal-in {
  from { opacity:0; transform: scale(0.95) translateY(20px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 1.2rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header__title {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 900; color: var(--text);
}
.modal-header__sub { font-size: 0.88rem; color: var(--text-sec); margin-top: 0.2rem; }

/* ── Indicateur d'étapes ──────────────────────────── */
.steps-indicator {
  display: flex; align-items: center; gap: 0.5rem;
}
.step {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; font-weight: 500; color: var(--text-light);
  white-space: nowrap;
}
.step span {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(20,184,166,0.08); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
}
.step--active { color: var(--primary); }
.step--active span { background: var(--primary-10); border-color: var(--primary); color: var(--primary); }
.step--done span  { background: var(--accent-10); border-color: var(--accent); color: #4a7a00; }
.step--done { color: #4a7a00; }
.step-line { width: 24px; height: 1px; background: var(--border); flex-shrink: 0; }

/* ── Étape titre ──────────────────────────────────── */
.step-title {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  margin-bottom: 1.4rem;
}

.profile-form { display: flex; flex-direction: column; }

.form-step { display: flex; flex-direction: column; gap: 1.3rem; }

/* Navigation entre étapes */
.step-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1rem; padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

/* ── Matières ─────────────────────────────────────── */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
}
.subject-check {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.6rem 0.9rem;
  background: var(--primary-05);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem; font-weight: 500; color: var(--text-sec);
  transition: all 0.2s;
}
.subject-check:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-10); }
.subject-check input {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.subject-check:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-10);
  color: var(--primary);
}

/* ── Champs dynamiques ────────────────────────────── */
.dynamic-fields {
  background: rgba(20,184,166,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.3rem;
  display: flex; flex-direction: column; gap: 0.8rem;
}
.dynamic-fields__title {
  font-size: 0.82rem; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.sub-option-group {
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  display: flex; flex-direction: column; gap: 0.55rem;
}
.sub-option-group strong {
  font-size: 0.88rem; color: var(--text); font-weight: 600;
}

.levels-group {
  display: flex; flex-wrap: wrap; gap: 0.45rem;
}
.level-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  background: rgba(20,184,166,0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 500; color: var(--text-sec);
  cursor: pointer; transition: all 0.18s;
}
.level-badge:hover { border-color: var(--primary); color: var(--primary); }
.level-badge:has(input:checked) {
  background: var(--primary-10); border-color: var(--primary);
  color: var(--primary); font-weight: 600;
}
.level-badge input {
  width: 14px; height: 14px; accent-color: var(--primary);
  flex-shrink: 0;
}

/* Certification */
.certif-field {
  margin-top: 0.4rem; padding-left: 0.8rem;
  border-left: 2px solid rgba(20,184,166,0.2);
}
.certif-field input[type="text"],
.certif-field input[type="file"] {
  width: 100%; padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}
.certif-field small { display: block; font-size: 0.68rem; color: var(--text-light); margin-top: 0.2rem; }

/* Champ prix dans les groupes dynamiques */
.price-row {
  display: flex; align-items: center; gap: 0.6rem;
  margin-top: 0.4rem;
}
.price-row label { font-size: 0.78rem; color: var(--text-sec); white-space: nowrap; }
.price-row input {
  width: 100px; padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: 0.85rem;
}

/* ── Médias ────────────────────────────────────────── */
.media-row {
  display: flex; align-items: flex-start; gap: 1.2rem;
  flex-wrap: wrap;
}
.media-upload-area {
  width: 140px; height: 140px; flex-shrink: 0;
  border: 2px dashed rgba(20,184,166,0.3);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  background: var(--primary-05);
  transition: border-color 0.2s, background 0.2s;
}
.media-upload-area:hover { border-color: var(--primary); background: var(--primary-10); }
.media-upload-area--wide { width: 100%; max-width: 320px; height: 120px; }

.media-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  color: var(--text-light); font-size: 0.78rem; text-align: center;
  padding: 0.5rem;
}
.media-placeholder__icon { font-size: 2rem; }

.media-hint {
  flex: 1;
}
.media-hint strong { font-size: 0.9rem; color: var(--text); display: block; margin-bottom: 0.35rem; }
.media-hint p { font-size: 0.78rem; color: var(--text-sec); line-height: 1.6; }

.video-upload-wrap {
  display: flex; align-items: flex-start; gap: 1.2rem; flex-wrap: wrap;
}

.optional-tag {
  font-size: 0.78rem; color: var(--text-light);
  text-align: center; padding: 0.4rem;
  border: 1px dashed var(--border); border-radius: 999px;
}

/* ── Bouton submit final ──────────────────────────── */
.btn-submit {
  padding: 0.92rem 2rem;
  font-size: 1rem;
  box-shadow: 0 6px 28px rgba(20,184,166,0.32);
}
.btn-submit:hover { box-shadow: 0 12px 40px rgba(20,184,166,0.42); }

/* ── Toast notification ───────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9000;
  padding: 0.85rem 1.3rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem; font-weight: 500;
  display: flex; align-items: center; gap: 0.6rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  max-width: 300px;
  animation: toast-in 0.35s cubic-bezier(0.34,1.3,0.64,1) both;
}
.toast--success {
  background: rgba(240,253,244,0.97);
  border: 1px solid rgba(132,204,22,0.3);
  color: #166534;
}
.toast--error {
  background: rgba(254,242,242,0.97);
  border: 1px solid rgba(239,68,68,0.3);
  color: #b91c1c;
}
@keyframes toast-in {
  from { opacity:0; transform: translateY(14px); }
  to   { opacity:1; transform: translateY(0); }
}

/* ── Spinner de chargement ────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .page { padding: 1.2rem 1rem; }
  .auth-card { padding: 1.8rem 1.3rem; }
  .modal-content { padding: 1.5rem 1.2rem; border-radius: var(--radius-lg); }
  .modal-header { flex-direction: column; }
  .form-row { flex-direction: column; }
  .half { flex: unset; width: 100%; }
  .subjects-grid { grid-template-columns: 1fr 1fr; }
  .steps-indicator { display: none; }
  .media-row, .video-upload-wrap { flex-direction: column; }
  .media-upload-area--wide { max-width: 100%; }
}

@media (max-width: 380px) {
  .subjects-grid { grid-template-columns: 1fr; }
}