/* ============================================================
   MON PSY IA — CSS Global
   ============================================================ */

:root {
  --cream:        #F7F4EF;
  --warm-white:   #FDFCFA;
  --teal-deep:    #1A6B6B;
  --teal-mid:     #2A9090;
  --teal-light:   #7ECECE;
  --teal-mist:    #E8F4F4;
  --sand:         #C8A97E;
  --sand-light:   #F0E8DC;
  --ink:          #1C2B2B;
  --ink-soft:     #3D5050;
  --muted:        #7A9090;
  --border:       rgba(42,144,144,0.15);
  --shadow-sm:    0 2px 8px rgba(26,107,107,0.08);
  --shadow-md:    0 8px 30px rgba(26,107,107,0.12);
  --shadow-lg:    0 20px 60px rgba(26,107,107,0.18);
  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    24px;
  --radius-full:  100px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── TYPOGRAPHIE ─── */
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
h3 { font-size: 1.15rem; }

a { color: var(--teal-mid); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--teal-deep); }

small { font-size: 0.78rem; color: var(--muted); }

/* ─── LOGO ─── */
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; width: fit-content;
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-mid));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.auth-logo span {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 600;
  color: var(--teal-deep);
}

/* ─── BOUTONS ─── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-mid));
  color: white !important;
  padding: 13px 28px;
  border-radius: var(--radius-full);
  font-size: 0.95rem; font-weight: 500;
  border: none; cursor: pointer;
  box-shadow: 0 6px 24px rgba(26,107,107,0.28);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  text-decoration: none;
  font-family: inherit;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(26,107,107,0.38);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-full { width: 100%; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent;
  color: var(--teal-deep);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  font-family: inherit; text-decoration: none;
}
.btn-secondary:hover {
  background: var(--teal-mist);
  border-color: var(--teal-light);
  color: var(--teal-deep);
}

.btn-danger {
  background: #c00; color: white;
  padding: 10px 20px; border-radius: var(--radius-full);
  border: none; cursor: pointer; font-size: 0.85rem; font-family: inherit;
  transition: background 0.2s;
}
.btn-danger:hover { background: #e00; }

/* ─── FORMULAIRES ─── */
.form-group { margin-bottom: 18px; }

label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.82rem; font-weight: 500;
  color: var(--ink-soft); margin-bottom: 6px;
}
.label-link { font-weight: 400; font-size: 0.78rem; color: var(--teal-mid); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--ink);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal-mid);
  box-shadow: 0 0 0 3px rgba(42,144,144,0.12);
}
input::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 80px; }

.input-password-wrap { position: relative; }
.input-password-wrap input { padding-right: 44px; }
.toggle-password {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; padding: 4px; color: var(--muted);
}

.form-check {
  display: flex; align-items: flex-start; gap: 10px;
}
.form-check input[type="checkbox"] {
  width: 16px; height: 16px; min-width: 16px;
  margin-top: 2px; cursor: pointer;
  accent-color: var(--teal-deep);
}
.form-check label {
  font-weight: 400; font-size: 0.85rem;
  color: var(--ink-soft); cursor: pointer;
  justify-content: flex-start;
  margin-bottom: 0;
}

.password-strength {
  margin-top: 6px;
  height: 4px; background: #eee; border-radius: 4px; overflow: hidden;
}
.strength-fill {
  height: 100%; width: 0; border-radius: 4px;
  transition: width 0.3s, background 0.3s;
}

/* ─── ALERTES ─── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.88rem; margin-bottom: 18px; border: 1px solid;
  line-height: 1.5;
}
.alert > div + div { margin-top: 4px; }
.alert-error   { background: #fff0f0; border-color: #ffb0b0; color: #c00; }
.alert-success { background: #f0faf5; border-color: #7ecece; color: var(--teal-deep); }
.alert-warning { background: #fff8e6; border-color: #f5c842; color: #7a5800; }
.alert-info    { background: var(--teal-mist); border-color: var(--teal-light); color: var(--teal-deep); }
.alert-warning { background: #fff8e6; border-color: #f5c842; color: #7a5800; }

/* ─── AUTH LAYOUT ─── */
.auth-page { background: var(--cream); min-height: 100vh; }

.auth-layout {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.auth-layout-simple {
  grid-template-columns: 1fr;
  place-items: center;
  padding: 40px 20px;
}
.auth-layout-simple .auth-form-wrap {
  max-width: 460px; width: 100%;
  background: white; border-radius: var(--radius-lg);
  padding: 48px; box-shadow: var(--shadow-lg);
}

/* Panneau gauche coloré */
.auth-panel {
  background: linear-gradient(150deg, var(--teal-deep) 0%, #0D4F4F 100%);
  padding: 48px;
  display: flex; flex-direction: column; gap: 0;
  position: relative; overflow: hidden;
}
.auth-panel-content {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  position: relative; z-index: 2;
}
.auth-panel-content h2 {
  font-family: 'Playfair Display', serif;
  color: white; font-size: 1.8rem; margin-bottom: 14px;
}
.auth-panel-content p {
  color: rgba(255,255,255,0.7); font-size: 1rem;
  line-height: 1.7; margin-bottom: 32px; font-weight: 300;
}
.auth-features {
  list-style: none; display: flex; flex-direction: column; gap: 12px;
}
.auth-features li {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  display: flex; align-items: center; gap: 10px;
}
.auth-panel-orb {
  position: absolute; width: 400px; height: 400px; border-radius: 50%;
  background: rgba(126,206,206,0.12);
  bottom: -150px; right: -100px;
  pointer-events: none;
}

/* Formulaire côté droit */
.auth-form-wrap {
  background: white;
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 56px;
  overflow-y: auto;
}
.auth-form-header { margin-bottom: 30px; }
.auth-form-header h1 { margin-bottom: 6px; }
.auth-form-header p { color: var(--muted); font-size: 0.9rem; }
.auth-form { display: flex; flex-direction: column; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 0.85rem; color: var(--muted); }

/* Success state */
.auth-success {
  text-align: center; padding: 20px 0;
}
.success-icon { font-size: 3rem; margin-bottom: 16px; }
.auth-success h2 { margin-bottom: 12px; }
.auth-success p { color: var(--muted); margin-bottom: 8px; font-weight: 300; }

/* ─── CARDS ─── */
.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 500;
}
.badge-premium { background: var(--teal-mist); color: var(--teal-deep); }
.badge-free    { background: var(--sand-light); color: #7a5800; }
.badge-success { background: #e8faf2; color: #1a8b55; }
.badge-error   { background: #fff0f0; color: #c00; }
.badge-warning { background: #fff8e6; color: #7a5800; }

/* ─── TABLES ADMIN ─── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 0.88rem;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--cream);
  font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted);
  font-weight: 500;
}
tr:hover td { background: rgba(232,244,244,0.3); }
td:last-child, th:last-child { text-align: right; }

/* ─── PAGINATION ─── */
.pagination {
  display: flex; gap: 6px; align-items: center;
  justify-content: center; margin-top: 24px;
}
.page-link {
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--ink-soft); font-size: 0.85rem;
  transition: all 0.2s; text-decoration: none; background: white;
}
.page-link:hover, .page-link.active {
  background: var(--teal-deep); color: white; border-color: var(--teal-deep);
}
.page-link.disabled { opacity: 0.4; pointer-events: none; }

/* ─── SPINNER ─── */
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(42,144,144,0.25);
  border-top-color: var(--teal-mid);
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-panel { display: none; }
  .auth-form-wrap { padding: 32px 24px; min-height: 100vh; justify-content: flex-start; padding-top: 48px; }
}
