@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --blue: #3e7bfa;
  --blue-dark: #2f5fe0;
  --violet: #8a4ff0;
  --gradient: linear-gradient(135deg, #3e7bfa 0%, #8a4ff0 100%);
  --gradient-soft: linear-gradient(135deg, rgba(62,123,250,0.10), rgba(138,79,240,0.10));
  --bg: #f5f7ff;
  --card-bg: #ffffff;
  --surface-2: #f0f2fc;
  --text: #161a3e;
  --muted: #6c7293;
  --muted-light: #9a9fc0;
  --line: #e7e9f7;
  --line-strong: #d6d9f0;
  --success: #16a34a;
  --success-bg: #e3f8ea;
  --success-text: #12703a;
  --danger: #dc2626;
  --warning-bg: #fdf1de;
  --warning-text: #9a5b0f;
  --radius: 28px;
  --radius-sm: 16px;
  --shadow: 0 10px 30px rgba(22, 26, 62, 0.08);
  --shadow-soft: 0 4px 14px rgba(22, 26, 62, 0.06);
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand .logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  flex-shrink: 0;
}

.brand .logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand h1 {
  font-size: 21px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--muted);
  font-size: 12.5px;
  display: block;
  font-weight: 500;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  width: 100%;
  max-width: 480px;
  margin-bottom: 20px;
}

.card h2 {
  margin-top: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card p.muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin: 14px 0 6px;
  color: var(--text);
  letter-spacing: 0.01em;
}

input, select {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
}

input[readonly] {
  background: var(--gradient-soft);
  color: var(--muted);
}

button {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin-top: 18px;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

button:hover { opacity: 0.92; }
button:active { transform: scale(0.99); }
button:disabled { background: var(--muted-light); cursor: not-allowed; opacity: 1; }

button.secondary {
  background: transparent;
  border: 1.5px solid var(--blue);
  color: var(--blue-dark);
}

button.success { background: var(--success); }
button.danger { background: var(--danger); }

.info-box {
  background: var(--gradient-soft);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 6px;
}

.info-box .row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 5px 0;
}

.info-box .row .label { color: var(--muted); font-weight: 500; }
.info-box .row .value { font-weight: 700; text-align: right; font-family: "JetBrains Mono", monospace; font-size: 13px; }

.qr-wrap {
  text-align: center;
  margin: 18px 0;
}

.qr-wrap img {
  border: 10px solid #fff;
  box-shadow: var(--shadow);
  border-radius: 20px;
}

.link-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  font-family: "JetBrains Mono", monospace;
  word-break: break-all;
  color: var(--text);
  margin-top: 8px;
}

.status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-family: "JetBrains Mono", monospace;
}

.status.attente { background: var(--warning-bg); color: var(--warning-text); }
.status.validee { background: var(--success-bg); color: var(--success-text); }

.order-item {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.order-item:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-soft);
}

.order-item .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.order-item .top strong { font-size: 15px; font-weight: 700; }
.order-item .addr { font-size: 13px; color: var(--muted); }

.btn-accepter {
  width: auto;
  display: inline-block;
  margin-top: 10px;
  margin-bottom: 0;
  padding: 9px 16px;
  font-size: 13px;
  border-radius: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-tile {
  background: var(--gradient-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.stat-tile .stat-value {
  font-size: 21px;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-tile .stat-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}

.list-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.list-actions button {
  width: auto;
  margin-top: 0;
  padding: 8px 14px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn-outline-danger {
  background: transparent;
  border: 1.5px solid var(--danger);
  color: var(--danger);
}

.btn-outline-success {
  background: transparent;
  border: 1.5px solid var(--success);
  color: var(--success);
}

.status.desactive {
  background: #fde8e8;
  color: #9b1c1c;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 10px;
  font-size: 14px;
}

.menu-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}

.menu-links a {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.menu-links a:hover {
  box-shadow: 0 14px 34px rgba(62,123,250,0.16);
  transform: translateY(-1px);
}

.menu-links a span {
  display: block;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  display: none;
}

.back-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-dark);
  text-decoration: none;
}

.ticket {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-top: 16px;
}

.ticket h3 {
  margin-top: 0;
  text-align: center;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ticket .row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}

.ticket .row span:last-child {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  text-align: right;
}

.ticket .row.total {
  font-size: 19px;
  font-weight: 800;
  border-bottom: none;
  margin-top: 6px;
}

.ticket .row.total span:last-child {
  font-size: 19px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media print {
  body * { visibility: hidden; }
  .ticket, .ticket * { visibility: visible; }
  .ticket { position: absolute; top: 0; left: 0; width: 100%; border: none; }
  button, .brand, .back-link { display: none !important; }
}

/* ===================== Splash screen (ouverture app) ===================== */

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--gradient);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.splash-screen.splash-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-logo-wrap {
  width: 112px;
  height: 112px;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(9, 12, 40, 0.35);
  animation: splashPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both,
             splashPulse 2s ease-in-out 0.7s infinite;
}

.splash-logo-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.splash-name {
  margin-top: 22px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  opacity: 0;
  animation: splashFadeUp 0.6s ease 0.35s forwards;
}

.splash-footer {
  position: absolute;
  bottom: 34px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.02em;
  opacity: 0;
  animation: splashFadeUp 0.6s ease 0.55s forwards;
}

.splash-footer strong {
  font-weight: 700;
  color: #ffffff;
}

@keyframes splashPop {
  0% { transform: scale(0.55); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

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

@media print {
  .splash-screen { display: none !important; }
}
