/* =====================================================================
   Crew Live — التصميم المشترك
   ===================================================================== */
:root {
  --green: #1E4636;
  --maroon: #6E2430;
  --gold: #B08A4A;
  --cream: #E7DCC8;
  --paper: #F7F2E8;
  --ink: #1b1f1d;
  --muted: #5d6660;
  --line: rgba(30, 70, 54, 0.16);
  --radius: 16px;
  --font: 'Tajawal', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.logo {
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--gold);
  font-size: 1.4rem;
}

/* ---------- الأزرار ---------- */
.btn {
  border: 0;
  border-radius: var(--radius);
  padding: 0.75em 1.2em;
  min-height: 48px;
  font-weight: 700;
  font-size: 1rem;
  background: var(--green);
  color: #fff;
  transition: transform 0.08s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-gold { background: var(--gold); }
.btn-danger { background: var(--maroon); }
.btn-ghost { background: transparent; color: var(--green); border: 2px solid var(--green); }
.btn-big { width: 100%; min-height: 58px; font-size: 1.2rem; }

.lang-toggle {
  position: fixed;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 20;
  border: 0;
  border-radius: 999px;
  padding: 0.35em 0.9em;
  min-height: 40px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.85);
  color: var(--green);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ---------- الحقول والاختيارات ---------- */
.field { display: block; border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.field > span, .field > legend { display: block; font-weight: 700; margin-bottom: 8px; padding: 0; }
.field small { color: var(--muted); font-weight: 400; }

input[type="text"] {
  width: 100%;
  font-size: 1.15rem;
  padding: 0.7em 0.9em;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
input[type="text"]:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176, 138, 74, 0.25); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45em 1em;
  min-height: 46px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }

.error { color: var(--maroon); font-weight: 700; min-height: 1.5em; margin: 6px 0; }

/* ---------- التحميل ---------- */
.center-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 16px;
  text-align: center;
}
.spinner {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 5px solid var(--cream);
  border-top-color: var(--green);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- شعار Powered by ---------- */
.powered {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 14px 0 18px;
  letter-spacing: 0.02em;
  direction: ltr;
}
.powered b { color: var(--gold); }

/* ---------- لوحة الرمز ---------- */
.pin-box { width: min(360px, 100%); text-align: center; }
.pin-box h1 { font-size: 1.4rem; margin: 6px 0 18px; color: var(--green); }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 6px; }
.pin-dots span {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid var(--green);
  transition: background 0.12s;
}
.pin-dots span.on { background: var(--green); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.pin-pad button {
  height: 72px;
  font-size: 1.8rem;
  font-weight: 700;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--green);
  box-shadow: 0 2px 0 var(--line);
}
.pin-pad button:active { background: var(--cream); }
.shake { animation: shake 0.4s; }
@keyframes shake {
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}
