:root {
  --bg: #071116;
  --bg-soft: rgba(11, 24, 30, 0.82);
  --card: rgba(9, 18, 24, 0.86);
  --card-strong: rgba(12, 24, 31, 0.96);
  --card-border: rgba(132, 180, 169, 0.18);
  --text: #f5efe3;
  --muted: #bdc7bf;
  --accent: #f0bc56;
  --accent-deep: #c56a2a;
  --accent-ice: #8cddd3;
  --accent-ink: #15262c;
  --danger: #ff8b78;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  --radius: 24px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(236, 133, 61, 0.16), transparent 30%),
    radial-gradient(circle at 85% 14%, rgba(114, 212, 212, 0.14), transparent 22%),
    linear-gradient(145deg, #041018 0%, #0b1c24 48%, #181514 100%);
  overflow-x: hidden;
}

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.panel-shell {
  width: min(1400px, calc(100% - 2rem));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.brand-name {
  display: block;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.topbar-actions,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ghost-link,
.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.ghost-link,
.secondary-button {
  border: 1px solid rgba(132, 180, 169, 0.18);
  background: rgba(9, 18, 24, 0.72);
  color: var(--text);
}

.primary-button {
  border: 1px solid rgba(240, 188, 86, 0.45);
  background: linear-gradient(135deg, rgba(240, 188, 86, 0.94), rgba(197, 106, 42, 0.94));
  color: #131211;
  font-weight: 700;
}

.danger-button {
  border: 1px solid rgba(255, 139, 120, 0.4);
  background: rgba(58, 18, 18, 0.82);
  color: var(--danger);
}

@media (hover: hover) {
  .ghost-link:hover,
  .primary-button:hover,
  .secondary-button:hover,
  .danger-button:hover {
    transform: translateY(-1px);
  }
}

.hero {
  position: relative;
  padding: 2.4rem;
  margin-bottom: 1.1rem;
  border: 1px solid rgba(240, 188, 86, 0.14);
  border-radius: calc(var(--radius) + 6px);
  background:
    linear-gradient(135deg, rgba(240, 188, 86, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    rgba(8, 17, 22, 0.78);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.7s ease-out both;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% auto;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(140, 221, 211, 0.16), transparent 62%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--accent-ice);
}

.hero h1,
.panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.3rem, 4vw, 4.2rem);
  max-width: 12ch;
  line-height: 0.96;
}

.hero-copy {
  max-width: 54rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 1.2rem 0 0;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}

.hero-metrics article,
.panel,
.status-card,
.summary,
.product-card,
.notice {
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  contain: paint;
}

.hero-metrics article {
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
}

.metric-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.25rem;
  align-items: start;
}

.auth-shell,
.directory-grid {
  display: grid;
  gap: 1.25rem;
}

.auth-shell {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.directory-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 1rem;
}

.directory-card {
  border-radius: 22px;
  padding: 1.2rem;
  background:
    linear-gradient(135deg, rgba(240, 188, 86, 0.08), transparent 55%),
    var(--card-strong);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}

.directory-card strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 0.55rem;
}

.directory-card p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.lead-panel {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.panel-content {
  display: grid;
  gap: 1.25rem;
}

.sidebar,
.top-panel,
.create-project-panel {
  animation: rise 0.7s ease-out both;
}

.project-switch select,
.input-group select {
  width: 100%;
  border: 1px solid rgba(114, 212, 212, 0.22);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  background: rgba(5, 12, 17, 0.8);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.project-switch select:focus,
.input-group select:focus {
  border-color: rgba(242, 184, 75, 0.55);
  box-shadow: 0 0 0 3px rgba(242, 184, 75, 0.12);
}

.project-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

.project-list-item {
  width: 100%;
  border: 1px solid rgba(132, 180, 169, 0.18);
  background: rgba(9, 18, 24, 0.72);
  color: var(--text);
  border-radius: 16px;
  padding: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.project-list-item strong,
.project-list-item span,
.project-list-item small {
  display: block;
}

.project-list-item span,
.project-list-item small {
  color: var(--muted);
}

.project-list-item.selected {
  border-color: rgba(240, 188, 86, 0.45);
  background:
    linear-gradient(135deg, rgba(240, 188, 86, 0.08), transparent 60%),
    rgba(12, 22, 29, 0.94);
}

.pending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.18);
  color: #ff9f9f;
  font-size: 0.9rem;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.setup-card {
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 1.1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--card-strong);
}

.setup-card.completed {
  border-color: rgba(140, 221, 211, 0.35);
}

.setup-card strong {
  display: block;
  margin-bottom: 0.4rem;
}

.setup-card p,
.setup-state {
  margin: 0;
  color: var(--muted);
}

.setup-state {
  display: inline-block;
  margin-bottom: 0.6rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.type-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.type-pill {
  border: 1px solid rgba(132, 180, 169, 0.22);
  background: rgba(9, 18, 24, 0.72);
  color: var(--text);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  font: inherit;
  cursor: pointer;
}

.type-pill.selected {
  border-color: rgba(240, 188, 86, 0.45);
  background:
    linear-gradient(135deg, rgba(240, 188, 86, 0.08), transparent 60%),
    rgba(12, 22, 29, 0.94);
}

.panel {
  border-radius: var(--radius);
  padding: 1.35rem;
  animation: rise 0.7s ease-out both;
}

.panel-checkout {
  animation-delay: 0.08s;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.notice {
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(240, 188, 86, 0.11), transparent 70%),
    var(--card-strong);
}

.notice strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent);
}

.notice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.notice span {
  color: var(--text);
  font-weight: 700;
}

.product-list {
  display: grid;
  gap: 0.95rem;
}

.product-card {
  width: 100%;
  text-align: left;
  color: var(--text);
  border-radius: 22px;
  padding: 1.1rem 1.05rem;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.product-card.selected {
  transform: translateY(-2px);
  border-color: rgba(242, 184, 75, 0.55);
  background:
    linear-gradient(135deg, rgba(240, 188, 86, 0.1), transparent 50%),
    rgba(25, 36, 42, 0.92);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.product-card.selected {
  position: relative;
}

.product-card.selected::after {
  content: "Selectionne";
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 700;
}

@media (hover: hover) {
  .product-card:hover,
  .product-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(242, 184, 75, 0.55);
    background:
      linear-gradient(135deg, rgba(240, 188, 86, 0.1), transparent 50%),
      rgba(25, 36, 42, 0.92);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  }
}

.product-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.product-card strong {
  font-size: 1.12rem;
}

.product-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.product-price {
  flex-shrink: 0;
  color: var(--accent);
  font-weight: 700;
}

.input-group {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.input-group span,
.summary span {
  color: var(--muted);
  font-size: 0.82rem;
}

.input-group input {
  width: 100%;
  border: 1px solid rgba(114, 212, 212, 0.22);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  background: rgba(5, 12, 17, 0.8);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.input-group textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid rgba(114, 212, 212, 0.22);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  background: rgba(5, 12, 17, 0.8);
  color: var(--text);
  font: inherit;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.input-group input:focus,
.input-group textarea:focus {
  border-color: rgba(242, 184, 75, 0.55);
  box-shadow: 0 0 0 3px rgba(242, 184, 75, 0.12);
}

.summary {
  border-radius: 18px;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--card-strong);
}

.summary-empty {
  margin: 0;
  color: var(--muted);
}

.summary-grid {
  display: grid;
  gap: 0.9rem;
}

.summary-grid article {
  display: grid;
  gap: 0.2rem;
}

.paypal-slot {
  min-height: 72px;
  margin: 1rem 0;
}

.paypal-buttons-host {
  min-height: 46px;
}

.paypal-slot .hint {
  margin-top: 0.75rem;
}

.hint,
.empty-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.status-card {
  border-radius: 18px;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(140, 221, 211, 0.05), rgba(255, 255, 255, 0)),
    var(--card-strong);
}

.status-card strong {
  display: block;
  margin-bottom: 0.35rem;
}

.status-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.status-card.status-error {
  border-color: rgba(255, 139, 120, 0.55);
  background: rgba(45, 18, 18, 0.74);
}

.admin-app {
  display: grid;
  gap: 1.25rem;
}

.admin-grid {
  grid-template-columns: 0.95fr 1.05fr;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.field-grid-full {
  grid-column: 1 / -1;
}

.admin-products {
  display: grid;
  gap: 1rem;
}

.admin-product-card {
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--card-strong);
}

.admin-product-head,
.save-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.save-panel-row {
  margin-bottom: 0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .hero-metrics,
  .grid {
    grid-template-columns: 1fr;
  }

  .lead-panel,
  .auth-shell,
  .setup-grid {
    grid-template-columns: 1fr;
  }

  .shell {
    width: min(100% - 1rem, 1120px);
    padding-top: 1.6rem;
  }

  .hero {
    padding-top: 1rem;
  }

  .topbar,
  .admin-product-head,
  .save-panel-row,
  .inline-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .hero {
    padding: 1.4rem;
  }

  .hero::after {
    display: none;
  }

  .hero-metrics article,
  .panel,
  .status-card,
  .summary,
  .product-card,
  .notice {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
