/* ==========================================================================
   ORION — Bento Editorial pour le flow (checkout + client-auth)
   Charge APRÈS flow.css pour override.
   ========================================================================== */

:root {
  --bg: #08090C;
  --bg-elevated: #101116;
  --bg-card: #16171D;
  --bg-soft: #0E0F14;
  --panel: #16171D;

  --text: #F4F4F5;
  --muted: #A1A1AA;
  --text-dim: #71717A;

  --line: rgba(255, 255, 255, 0.08);
  --hairline: rgba(255, 255, 255, 0.06);
  --hairline-strong: rgba(255, 255, 255, 0.14);
  --border-hover: rgba(99, 102, 241, 0.45);

  --brand: #6366F1;
  --brand-2: #4F46E5;
  --accent-cyan: #22D3EE;
  --accent-violet: #A78BFA;
  --accent-success: #10B981;

  --bg-gradient-1: rgba(99, 102, 241, 0.18);
  --bg-gradient-2: rgba(34, 211, 238, 0.12);
  --bg-gradient-3: rgba(167, 139, 250, 0.10);

  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  --radius: 20px;
  --radius-sm: 12px;
}

:root[data-theme="light"] {
  --bg: #FAFAF9;
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-soft: #F4F4F5;
  --panel: #FFFFFF;
  --text: #0A0A0B;
  --muted: #52525B;
  --text-dim: #71717A;
  --line: rgba(10, 10, 11, 0.08);
  --hairline: rgba(10, 10, 11, 0.05);
  --hairline-strong: rgba(10, 10, 11, 0.14);
  --bg-gradient-1: rgba(99, 102, 241, 0.1);
  --bg-gradient-2: rgba(34, 211, 238, 0.07);
  --bg-gradient-3: rgba(167, 139, 250, 0.06);
}

body {
  font-family: var(--font-body);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  background:
    radial-gradient(ellipse 60% 50% at 18% 12%, var(--bg-gradient-1), transparent 60%),
    radial-gradient(ellipse 55% 45% at 82% 28%, var(--bg-gradient-2), transparent 60%),
    radial-gradient(ellipse 70% 50% at 50% 95%, var(--bg-gradient-3), transparent 60%),
    var(--bg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
}

:root[data-theme="light"] body::after { opacity: 0.04; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--text);
}

h1 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.2rem, 2vw, 1.45rem);
}

/* Mini header */
.flow-header {
  width: min(980px, calc(100% - 24px));
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.flow-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.flow-wordmark::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--brand), var(--accent-cyan));
}

.flow-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flow-theme-toggle {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline-strong);
  background: var(--bg-card);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  transition: background 180ms ease, transform 180ms ease;
}

.flow-theme-toggle:hover {
  background: rgba(255,255,255,0.06);
  transform: scale(1.05);
}

.flow-theme-toggle svg {
  width: 16px;
  height: 16px;
}

.flow-theme-toggle .icon-sun { display: none; }
.flow-theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .flow-theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .flow-theme-toggle .icon-moon { display: none; }

/* Container */
.container {
  width: min(980px, calc(100% - 24px));
  margin: 24px auto 60px;
}

/* Card */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 32px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 8px 24px rgba(0,0,0,0.32);
}

/* Top row */
.row {
  align-items: flex-start;
}

.row h1 + p {
  margin-top: 6px;
}

.muted {
  color: var(--muted) !important;
}

/* Inputs */
input,
select {
  background: var(--bg-elevated);
  border: 1px solid var(--hairline-strong);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-family: var(--font-body);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input::placeholder {
  color: var(--text-dim);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--bg-soft);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  gap: 8px;
}

label input,
label select {
  font-family: var(--font-body);
  font-size: 0.96rem;
  letter-spacing: -0.005em;
  text-transform: none;
  color: var(--text);
  font-weight: 400;
}

/* Span full utility */
.span-full { grid-column: 1 / -1; }

/* Buttons */
.btn {
  border-radius: 999px;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-weight: 600;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent-violet) 100%);
  color: #FFFFFF;
  border: 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 8px 24px rgba(99, 102, 241, 0.32);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 12px 32px rgba(99, 102, 241, 0.46);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--hairline-strong);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-stripe {
  background: linear-gradient(135deg, #635BFF 0%, #4F46E5 100%);
  color: #FFFFFF;
  border: 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 8px 24px rgba(99, 91, 255, 0.32);
}

.btn-stripe:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 12px 32px rgba(99, 91, 255, 0.46);
}

.btn-paypal {
  background: linear-gradient(135deg, #FFD140 0%, #FFC439 100%);
  color: #003087;
  border: 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    0 8px 24px rgba(255, 196, 57, 0.32);
}

.btn-paypal:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.5),
    0 12px 32px rgba(255, 196, 57, 0.46);
}

/* Switch (segmented pill) */
.switch {
  display: inline-flex;
  gap: 0;
  padding: 4px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: var(--bg-card);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 4px 12px rgba(0, 0, 0, 0.2);
  margin-top: 12px;
}

.switch-btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 18px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

.switch-btn:hover { color: var(--text); }

.switch-btn.is-active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Grid (form 2 cols) */
.grid {
  margin-top: 18px;
}

/* Plan summary */
.plan-summary {
  margin-top: 18px;
}

.plan-summary h3 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 10px !important;
}

.plan-summary .features-list {
  padding: 0;
  margin: 6px 0 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-summary .features-list li {
  position: relative;
  padding-left: 26px;
  font-size: 0.94rem;
  color: var(--text);
  line-height: 1.45;
}

.plan-summary .features-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.14);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310B981' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px;
  border: 1px solid rgba(16, 185, 129, 0.32);
}

/* Payment summary block */
.payment-summary {
  margin-top: 18px;
  background:
    radial-gradient(ellipse 80% 100% at 0% 0%, rgba(99, 102, 241, 0.10), transparent 70%),
    var(--bg-elevated);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: grid;
  gap: 4px;
}

.payment-summary p {
  margin: 0;
}

.payment-summary p.muted {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim) !important;
  font-weight: 600;
  margin: 0 0 2px;
}

.payment-summary p.muted + .summary-main {
  margin-bottom: 12px;
}

.payment-summary p.muted + .summary-main:last-child {
  margin-bottom: 0;
}

.summary-main {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Last summary-main = montant -> en gradient text */
.payment-summary .summary-main:last-of-type {
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-size: 1.55rem;
}

/* Provider actions */
.provider-actions {
  margin-top: 22px;
  gap: 12px;
}

.provider-actions .btn {
  padding: 14px 20px;
  font-weight: 600;
}

/* Notice (error message) */
.notice {
  font-size: 0.92rem;
  margin-top: 14px;
  padding: 0;
  color: #FCA5A5;
}

.notice:not(:empty) {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(252, 110, 129, 0.08);
  border: 1px solid rgba(252, 110, 129, 0.32);
}

/* Checkout layout */
.checkout-layout {
  margin-top: 22px;
  gap: 16px;
}

/* Actions inline */
.actions {
  margin-top: 18px;
}

.actions .btn {
  flex: 0 1 auto;
}

/* Hidden util */
.hidden { display: none !important; }

/* ---------- Pages status (checkout-cancel / checkout-success) ---------- */

.flow-status {
  width: min(560px, calc(100% - 24px));
  margin: clamp(40px, 10vh, 100px) auto 60px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.flow-status .card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: clamp(28px, 4vw, 48px);
  text-align: center;
}

.flow-status-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.flow-status-icon::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  opacity: 0.4;
  z-index: -1;
  filter: blur(8px);
}

.flow-status-icon svg {
  width: 36px;
  height: 36px;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.flow-status-icon--success {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
}

.flow-status-icon--success::after {
  background: rgba(16, 185, 129, 0.5);
}

.flow-status-icon--error {
  background: rgba(252, 110, 129, 0.14);
  border: 1px solid rgba(252, 110, 129, 0.4);
  color: #FCA5A5;
}

.flow-status-icon--error::after {
  background: rgba(252, 110, 129, 0.5);
}

.flow-status h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.flow-status p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 44ch;
}

.flow-status-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.flow-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

.flow-status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.flow-status-badge--success .dot { background: var(--accent-success); }
.flow-status-badge--error   .dot { background: #FCA5A5; }

/* --- Light mode ajustements de contraste --- */
:root[data-theme="light"] .payment-summary .summary-main:last-of-type {
  background: linear-gradient(135deg, #4338CA 0%, #0E7490 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

:root[data-theme="light"] .flow-status-icon--success {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.45);
  color: #047857;
}
:root[data-theme="light"] .flow-status-icon--success::after {
  background: rgba(16, 185, 129, 0.4);
}

:root[data-theme="light"] .flow-status-icon--error {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.40);
  color: #B91C1C;
}
:root[data-theme="light"] .flow-status-icon--error::after {
  background: rgba(220, 38, 38, 0.35);
}

:root[data-theme="light"] .flow-status-badge--success { color: #047857; }
:root[data-theme="light"] .flow-status-badge--success .dot { background: #047857; }

:root[data-theme="light"] .flow-status-badge--error { color: #B91C1C; }
:root[data-theme="light"] .flow-status-badge--error .dot { background: #B91C1C; }

:root[data-theme="light"] .notice:not(:empty) {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.32);
  color: #B91C1C;
}

/* Responsive */
@media (max-width: 760px) {
  .row {
    flex-direction: column;
    align-items: stretch;
  }
  .row .btn {
    width: 100%;
    text-align: center;
  }
  .actions .btn {
    width: 100%;
  }
  .flow-header {
    padding: 10px 0;
  }
}
