/*
 * Noces QR — thème « Moderne épuré ».
 * Couche de présentation uniquement : chargée après app.css et php-extra.css,
 * elle ne modifie ni la structure HTML ni le fonctionnement.
 */

/* ------------------------------------------------------------------ Jetons */
:root {
  --wine: #7a3349;
  --wine-dark: #4f2131;
  --wine-soft: #f6eef0;
  --gold: #c39a57;
  --cream: #f7f5f2;
  --paper: #ffffff;
  --ink: #1f1a1c;
  --muted: #6b6366;
  --line: #ebe5e1;
  --line-strong: #ddd5d0;
  --green: #2f7a5c;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(31, 26, 28, .04), 0 10px 30px rgba(31, 26, 28, .06);
  --shadow-sm: 0 1px 2px rgba(31, 26, 28, .05), 0 2px 8px rgba(31, 26, 28, .04);
  --shadow-lg: 0 2px 6px rgba(31, 26, 28, .05), 0 24px 60px rgba(31, 26, 28, .12);
  --ring: 0 0 0 4px rgba(122, 51, 73, .14);
  --saas-line: var(--line);
  --saas-surface: #fff;
}

html { background: var(--cream); }
body { background: var(--cream); color: var(--ink); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
::selection { background: rgba(122, 51, 73, .16); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 10px; }
a { text-underline-offset: 3px; }

/* Défilement fin et discret */
* { scrollbar-width: thin; scrollbar-color: #d9cfca transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #d9cfca; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* Titres : plus nets, interlignage resserré */
h1, h2, h3 { letter-spacing: -.015em; text-wrap: balance; }
.eyebrow { letter-spacing: .14em; color: #9b6a52; font-weight: 750; }
.page-heading h1, .dashboard-content h1 { letter-spacing: -.025em; }
p { text-wrap: pretty; }

/* ----------------------------------------------------------------- Boutons */
.primary-button, a.primary-button {
  background: var(--wine);
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(79, 33, 49, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
  font-weight: 650;
  letter-spacing: .005em;
  transition: background-color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.primary-button:hover:not(:disabled) { background: var(--wine-dark); box-shadow: 0 6px 18px rgba(79, 33, 49, .25); }
.primary-button:active:not(:disabled) { transform: translateY(1px); }
.primary-button:disabled { opacity: .55; box-shadow: none; }

.secondary-button, a.secondary-button {
  background: #fff;
  color: #4a3d42;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.secondary-button:hover:not(:disabled) { background: #faf7f5; border-color: #cfc4be; color: var(--ink); }
button, a { -webkit-tap-highlight-color: transparent; }

/* ------------------------------------------------------- Champs de saisie */
.field > span { color: #3f3538; font-weight: 600; }
.field input, .field select, .field textarea,
.auth-form .field input,
.guest-tools input, .guest-tools select,
.print-field select, .wedding-form input, .wedding-form textarea, .wedding-form select,
.account-form input, .account-form select {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input:hover, .field select:hover, .field textarea:hover, .guest-tools input:hover, .guest-tools select:hover { border-color: #cbbfb9; }
.field input:focus, .field select:focus, .field textarea:focus,
.guest-tools input:focus, .guest-tools select:focus, .print-field select:focus,
.account-form input:focus {
  outline: none;
  border-color: var(--wine);
  box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: #a39a9d; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--wine); }

/* Barre de recherche des invités : le champ prend la place disponible */
.guest-tools { gap: 10px; }
.guest-tools .search-box { flex: 1 1 auto; min-width: 0; }
@media (min-width: 701px) { .guest-tools > select { width: 190px; flex: 0 0 190px; } }

/* --------------------------------------------------------- Cartes et panneaux */
.panel, .stat-card, .table-card, .account-form, .quick-panel {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.panel { border-radius: var(--radius-lg); }
.stat-card { border-radius: 18px; }
.stat-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.table-card { border-radius: 18px; }
.table-card:hover { box-shadow: var(--shadow); }
.smart-panel-summary { border-radius: 16px; }
.smart-panel-summary:hover { background: #fcfaf9; }

/* Listes */
.guest-row { border-top-color: #f0ebe8; transition: background-color .15s ease; border-radius: 12px; }
.guest-row:hover { background: #fbf8f7; }

/* Pastilles de statut */
.delivery-pill, .register-status, .register-table-pill, .invite-type-badge, .receipt-status { border-radius: 999px; font-weight: 650; }

/* ------------------------------------------------------- Tableau de bord */
.dashboard-main { background: var(--cream); }
.dashboard-header {
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.dashboard-settings-link, .dashboard-menu-toggle { border-radius: 12px; border-color: var(--line-strong); background: #fff; box-shadow: var(--shadow-sm); }
.global-live-status { border-radius: 999px; }

/* Barre latérale claire et aérée */
.dashboard-shell .sidebar { background: #fff; color: var(--ink); border-right: 1px solid var(--line); box-shadow: none; padding: 26px 16px 18px; }
.dashboard-shell .sidebar .brand { color: var(--ink); }
.dashboard-shell .sidebar nav button { color: #4a3f43; font-size: 15px; border-radius: 10px; min-height: 42px; }
.dashboard-shell .sidebar nav button .nav-icon { color: #8a7d82; }
.dashboard-shell .sidebar nav button:hover { color: var(--ink); background: #f6f2f0; transform: none; }
.dashboard-shell .sidebar nav button.active { color: var(--wine); background: var(--wine-soft); box-shadow: inset 3px 0 0 var(--wine); font-weight: 650; }
.dashboard-shell .sidebar nav button.active .nav-icon { color: var(--wine); }
.dashboard-shell .sidebar nav button small { color: #6b5f63; background: #f1ecea; font-weight: 650; }
.dashboard-shell .sidebar nav button.active small { color: #fff; background: var(--wine); }
.dashboard-shell .sidebar .workspace-nav-group > summary { color: #8a7d82; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.dashboard-shell .sidebar .workspace-nav-group > summary:hover { color: var(--ink); background: transparent; }
.dashboard-shell .wedding-switcher { background: #faf8f7; border: 1px solid var(--line); }
.dashboard-shell .wedding-switcher label span { color: #8a7d82; }
.dashboard-shell .wedding-switcher select { color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; }
.dashboard-shell .wedding-switcher button { color: var(--wine); }
.dashboard-shell .sidebar-profile { border-top: 1px solid var(--line); }
.dashboard-shell .sidebar-profile strong { color: var(--ink); }
.dashboard-shell .sidebar-profile span { color: var(--muted); }
.dashboard-shell .sidebar-profile a, .dashboard-shell .sidebar-profile > div:last-child a { color: var(--wine); }

/* Menu latéral mobile et barre de navigation inférieure */
.dashboard-menu-drawer { box-shadow: var(--shadow-lg); }
.mobile-nav { background: rgba(28, 22, 25, .92); border-color: rgba(255, 255, 255, .08); box-shadow: 0 12px 40px rgba(20, 14, 17, .28); }
.mobile-nav button { border-radius: 12px; }
.mobile-nav button.active { background: rgba(255, 255, 255, .1); color: #fff; }

/* Fenêtres (dialogues) */
dialog { border: 0; }
dialog::backdrop { background: rgba(31, 26, 28, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal-heading > button { border-radius: 10px; background: #f5efed; color: #6b4a55; transition: background-color .15s ease; }
.modal-heading > button:hover { background: #ede3df; }

/* Notifications éphémères */
.toast { border-radius: 14px; background: #1f1a1c; box-shadow: var(--shadow-lg); }

/* ---------------------------------------------------------- Pages publiques */
.public-header .header-cta { border-radius: 12px; box-shadow: var(--shadow-sm); }
.public-header nav a { transition: color .15s ease; }

/* Connexion / inscription */
.auth-page { background: radial-gradient(circle at 12% 0%, rgba(122, 51, 73, .10), transparent 36%), var(--cream); }
.auth-card { background: #fff; border-color: var(--line); box-shadow: var(--shadow-lg); }
.auth-action h2 { letter-spacing: -.02em; }
.auth-form { gap: 16px; }
.auth-form .field input { min-height: 48px; font-size: 15px; }

/* Boutons de connexion Google / Apple / Microsoft */
.social-buttons { display: grid; gap: 10px; width: 100%; margin: 4px 0 2px; }
.social-button {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: #fff; color: #1f1a1c;
  font-size: 15px; font-weight: 600; text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.social-button:hover { background: #faf8f7; border-color: #cfc4be; }
.social-button svg { flex: none; }
.social-apple { background: #000; color: #fff; border-color: #000; }
.social-apple:hover { background: #1c1c1e; border-color: #1c1c1e; }
.auth-divider { margin: 18px 0 14px; text-transform: none; letter-spacing: 0; font-size: 13px; }

/* Page compte */
.account-layout > aside { background: linear-gradient(180deg, #2a2025, #1d171a); box-shadow: var(--shadow-lg); }
.account-header { border-bottom: 1px solid var(--line); }

/* ------------------------------------------------------- Invitation invité */
.invitation-page { background:
  radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--invite-primary) 12%, transparent), transparent 38%),
  radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--invite-accent) 14%, transparent), transparent 40%),
  #f8f5f1; }

/* ------------------------------------------------------- Poste de contrôle */
.control-header { background: rgba(255, 255, 255, .85); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }

/* ----------------------------------------------------- Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------- Super administration */
.admin-shell { background: var(--cream); }
.admin-header { background: rgba(255, 255, 255, .85); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.admin-shortcuts, .admin-toolbar { width: min(1196px, 100% - 44px); margin-left: auto; margin-right: auto; }
.admin-shortcuts { gap: 8px; padding: 18px 0 6px; }
.admin-shortcuts a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; text-decoration: none; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-sm); }
.admin-shortcuts a:hover { border-color: var(--line-strong); background: var(--wine-soft); }
.admin-toolbar { margin-top: 10px; }
.admin-toolbar input[type="search"] { background: #fff; }

/* Bouton « Lien mot de passe » de la super administration */
.account-reset-link { min-height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: #4a3d42; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.account-reset-link:hover { background: var(--wine-soft); color: var(--wine); }
.reset-link-modal { position: fixed; inset: 0; margin: auto; height: fit-content; width: min(520px, calc(100% - 24px)); padding: 22px; border-radius: 20px; box-shadow: var(--shadow-lg); }
.reset-link-modal .modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ------------------------------------------- Connexions et diagnostic (administration) */
.connexions-page { width: min(1100px, 100% - 32px); margin: 32px auto 70px; display: grid; gap: 18px; }
.connexions-page .page-heading { margin-bottom: 4px; align-items: flex-start; }
.connexions-page .page-heading p { color: var(--muted); max-width: 720px; }
.connexions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.connexion-card { display: grid; gap: 14px; padding: 22px; }
.connexion-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.connexion-card h2 { margin: 0; font-size: 22px; }
.connexion-status { padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 650; }
.connexion-status.on { background: #e8f4ee; color: var(--green); }
.connexion-status.off { background: #f3efed; color: var(--muted); }
.connexion-steps { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.55; display: grid; gap: 4px; }
.connexion-console { color: var(--wine); font-weight: 650; font-size: 14px; text-decoration: none; }
.connexion-card .field input, .connexion-card .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-size: 14px; }
.connexion-card .field textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; resize: vertical; }
.connexion-card .terms-check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.connexions-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.diag-panel { padding: 20px 22px; }
.diag-panel h2 { margin: 0 0 10px; font-size: 18px; }
.diag-list { list-style: none; margin: 0; padding: 0; display: grid; }
.diag-list li { display: grid; grid-template-columns: 28px minmax(0, 260px) 1fr; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid #f0ebe8; font-size: 14px; }
.diag-list li:first-child { border-top: 0; }
.diag-list small { color: var(--muted); word-break: break-word; }
.diag-dot { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 800; }
.diag-ok .diag-dot { background: #e8f4ee; color: var(--green); }
.diag-warn .diag-dot { background: #fff3dc; color: #a2690f; }
.diag-ko .diag-dot { background: #fbe9ec; color: #b42d43; }
.diag-ko strong { color: #b42d43; }
.diag-log { margin: 0; max-height: 360px; overflow: auto; white-space: pre-wrap; background: #f7f3f1; border-radius: 12px; padding: 12px; font-size: 12px; }
@media (max-width: 640px) { .diag-list li { grid-template-columns: 28px 1fr; } .diag-list small { grid-column: 2; } }

/* Mobile : le formulaire (et les boutons Google / Apple / Microsoft) passe en premier */
@media (max-width: 700px) {
  .auth-card > .auth-visual { display: none; }
  .auth-action { padding-top: 26px; }
}
