/* ==============================================
   DESIGN SYSTEM — Manon & Basile
   Aesthetic: Cozy Modern Personal
   ============================================== */

:root {
  /* Colors */
  --bg:            #faf7f3;
  --surface:       #ffffff;
  --surface-2:     #f4efe9;
  --border:        #e8dfd4;
  --text:          #1c1917;
  --text-muted:    #9c8f84;
  --accent:        #e07a5f;
  --accent-hover:  #d4694d;
  --accent-subtle: rgba(224, 122, 95, 0.09);
  --manon:         #e07a5f;
  --basile:        #4a7fa5;
  --success:       #6aaa82;
  --danger:        #c75858;

  /* Border radius */
  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-full: 999px;

  /* Typography */
  --font-display: 'Syne', system-ui, sans-serif;
  --font-body:    'Nunito', system-ui, sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 6px rgba(28, 25, 23, 0.06);
  --shadow:    0 3px 16px rgba(28, 25, 23, 0.09);
  --shadow-lg: 0 8px 32px rgba(28, 25, 23, 0.12);
  --shadow-accent: 0 6px 24px rgba(224, 122, 95, 0.18);

  /* Transitions */
  --t: 0.2s ease;
}

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

/* ——— Base ——— */
html { font-size: 16px; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ——— Typography ——— */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all var(--t);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 10px rgba(224, 122, 95, 0.25);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}
.btn-danger:hover {
  background: rgba(199, 88, 88, 0.08);
}

.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ——— Inputs ——— */
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  -webkit-appearance: none;
  appearance: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239c8f84' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 2.5rem;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* ——— Back button ——— */
.back-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all var(--t);
  cursor: pointer;
}
.back-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

/* ——— Card / Surface ——— */
.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.card-sm {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
}

/* ——— Divider ——— */
.divider {
  height: 1.5px;
  background: var(--border);
  margin: 1.25rem 0;
  border-radius: 999px;
}

/* ——— Badges ——— */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-accent  { background: var(--accent-subtle); color: var(--accent); }
.badge-manon   { background: rgba(224,122,95,0.1);  color: var(--manon); }
.badge-basile  { background: rgba(74,127,165,0.1);  color: var(--basile); }
.badge-success { background: rgba(106,170,130,0.1); color: var(--success); }

/* ——— Status dot ——— */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  display: inline-block;
  transition: all var(--t);
}
.status-dot.active {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

/* ——— Modal Overlay ——— */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal-inner {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 430px;
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
  box-shadow: var(--shadow-lg);
}
.modal-overlay.active .modal-inner {
  transform: translateY(0) scale(1);
}

/* ——— Scrollbar ——— */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ——— Animations ——— */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.fade-up  { animation: fadeUp  0.4s ease both; }
.fade-in  { animation: fadeIn  0.3s ease both; }
.scale-in { animation: scaleIn 0.3s ease both; }

/* ——— Staggered animation delays ——— */
.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.1s; }
.fade-up:nth-child(3) { animation-delay: 0.15s; }
.fade-up:nth-child(4) { animation-delay: 0.2s; }
.fade-up:nth-child(5) { animation-delay: 0.25s; }
.fade-up:nth-child(6) { animation-delay: 0.3s; }
.fade-up:nth-child(7) { animation-delay: 0.35s; }

/* ——— Utilities ——— */
.hidden       { display: none !important; }
.text-muted   { color: var(--text-muted); }
.text-accent  { color: var(--accent); }
.text-manon   { color: var(--manon); }
.text-basile  { color: var(--basile); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-center  { text-align: center; }
.text-sm      { font-size: 0.85rem; }
.text-xs      { font-size: 0.75rem; }
.font-bold    { font-weight: 700; }

.error-msg {
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity var(--t);
  text-align: center;
  margin-top: 0.5rem;
  min-height: 1.2em;
}
.error-msg.visible { opacity: 1; }
