/* Shared styles for the registration form (index.php) and the admin page (admin/index.php). */

:root {
  --navy: #183254;
  --navy-dark: #10243f;
  --gold: #cfa762;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #17243a;
  --muted: #6c788b;
  --border: #dde4ee;
  --danger: #c83e4d;
  --success: #16835f;
  --shadow: 0 16px 44px rgba(24, 50, 84, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Alexandria', Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(207,167,98,.14), transparent 29rem),
    linear-gradient(180deg, #f9fbfe 0%, var(--bg) 100%);
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 40px; }
.header { text-align: center; margin-bottom: 22px; }
.logo { width: 125px; max-width: 40vw; height: auto; display: block; margin: 0 auto 22px; }
.header h1 { margin: 0; font-size: clamp(1.35rem, 2.7vw, 2rem); color: var(--navy); }
.header p { margin: 18px auto 0; color: var(--muted); font-size: .94rem; }
.program-name {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: clamp(.82rem, 1.6vw, .95rem);
  font-weight: 600;
  letter-spacing: .02em;
}

.terms-card {
  width: min(760px, 100%);
  margin: 0 auto 20px;
  padding: clamp(18px, 3.4vw, 26px) clamp(20px, 4vw, 32px);
  border-right: 4px solid var(--gold);
}
.terms-card h2 { margin: 0 0 14px; color: var(--navy); font-size: 1.05rem; }
.terms-list { margin: 0; padding: 0; list-style: none; }
.terms-list li {
  position: relative;
  padding-right: 26px;
  color: var(--text);
  font-size: .9rem;
  line-height: 1.9;
}
.terms-list li + li { margin-top: 8px; }
.terms-list li::before {
  content: '';
  position: absolute;
  right: 0;
  top: .72em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--surface);
  border: 1px solid rgba(221,228,238,.9);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-card { width: min(760px, 100%); margin: 0 auto; padding: clamp(20px, 4vw, 36px); }
.section-title { margin: 0 0 6px; color: var(--navy); font-size: 1.18rem; }
.section-note { margin: 0 0 26px; color: var(--muted); font-size: .88rem; line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field.full { grid-column: 1 / -1; }
label.field-label { display: block; margin-bottom: 8px; font-size: .9rem; font-weight: 700; color: var(--navy); }
.required { color: var(--danger); }

.input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  outline: none;
  color: var(--text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(207,167,98,.16); }

select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-left: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 2l5 5 5-5' stroke='%236c788b' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  background-size: 12px 8px;
}
/* Nothing chosen yet: the placeholder option is the only invalid state. */
select.input:invalid { color: var(--muted); }
select.input option { color: var(--text); }

#phone {
  direction: rtl;
  text-align: right;
}
#phone::placeholder {
  direction: rtl;
  text-align: right;
}

.radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: .18s ease;
  user-select: none;
}
.choice label::before {
  content: '';
  width: 17px;
  height: 17px;
  margin-left: 9px;
  border: 2px solid #aab5c5;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px white;
  flex: 0 0 auto;
}
.choice input:checked + label { border-color: var(--gold); background: rgba(207,167,98,.10); color: var(--navy); }
.choice input:checked + label::before { background: var(--gold); border-color: var(--gold); }

.file-drop {
  position: relative;
  min-height: 104px;
  border: 1.5px dashed #b9c5d5;
  border-radius: 14px;
  background: #fbfcfe;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  cursor: pointer;
  transition: .2s ease;
}
.file-drop:hover, .file-drop.drag { border-color: var(--gold); background: rgba(207,167,98,.07); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-title { color: var(--navy); font-weight: 700; font-size: .9rem; }
.file-meta { margin-top: 5px; color: var(--muted); font-size: .76rem; line-height: 1.5; word-break: break-word; }
.file-selected { color: var(--success); }

.actions { margin-top: 25px; display: flex; gap: 10px; align-items: center; }
.btn {
  border: 0;
  border-radius: 12px;
  min-height: 47px;
  padding: 11px 20px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .15s ease, opacity .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .58; cursor: not-allowed; transform: none; }
.btn-primary { color: white; background: var(--navy); box-shadow: 0 9px 20px rgba(24,50,84,.22); }
.btn-secondary { color: var(--navy); background: #edf2f8; }
.btn-gold { color: var(--navy-dark); background: var(--gold); }
.btn-danger { color: var(--danger); background: #fff0f2; }
.submit-btn { min-width: 180px; }

.status { display: none; margin-top: 16px; border-radius: 12px; padding: 12px 14px; font-size: .86rem; line-height: 1.6; }
.status.show { display: block; }
.status.success { color: #0d674a; background: #e9f8f2; border: 1px solid #c1eadc; }
.status.error { color: #a62938; background: #fff0f2; border: 1px solid #f4cad0; }

.success-panel { display: none; width: min(760px, 100%); margin: 0 auto; padding: clamp(34px, 6vw, 58px) 24px; text-align: center; }
.success-panel.show { display: block; animation: fade .25s ease; }
.success-icon { width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: #e9f8f2; color: var(--success); font-size: 2.4rem; font-weight: 700; }
.success-panel h2 { margin: 0; color: var(--navy); font-size: clamp(1.35rem, 3vw, 1.8rem); }
.success-panel p { margin: 12px 0 0; color: var(--muted); line-height: 1.8; }
.success-panel .btn { margin-top: 24px; }

.admin-login { width: min(470px, 100%); margin: 0 auto; padding: clamp(22px, 5vw, 38px); text-align: center; }
.admin-login .input { margin-top: 16px; }
.admin-login .btn { margin-top: 12px; width: 100%; }

.admin-panel { display: none; }
.admin-panel.show { display: block; }
.admin-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.admin-toolbar .search { flex: 1 1 250px; }
.stats { padding: 0 16px; color: var(--muted); font-size: .86rem; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1240px; }
th, td { padding: 13px 12px; text-align: right; border-bottom: 1px solid #e8edf4; font-size: .8rem; vertical-align: middle; }
th { color: white; background: var(--navy); position: sticky; top: 0; z-index: 2; white-space: nowrap; }
tbody tr:hover { background: #f8fafc; }
.file-btn { border: 0; color: var(--navy); background: #edf2f8; border-radius: 9px; padding: 8px 10px; cursor: pointer; font-weight: 700; white-space: nowrap; }
.empty { padding: 45px 20px; text-align: center; color: var(--muted); }

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .75s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer { text-align: center; color: #8190a5; font-size: .75rem; margin-top: 24px; }

@media (max-width: 680px) {
  .app-shell { width: min(100% - 18px, 1180px); padding-top: 18px; }
  .form-grid, .radio-grid { grid-template-columns: 1fr; }
  .actions { flex-direction: column; align-items: stretch; }
  .submit-btn { width: 100%; }
  .admin-toolbar .btn { flex: 1 1 auto; padding-inline: 12px; }
  .header p { font-size: .82rem; }
  .card { border-radius: 17px; }
}

/* --- Review status ------------------------------------------------------- */
/* Colour sits on the row, not just the pill, so a decision is readable while
   scanning the table. Kept light enough that the text stays legible. */
tr.row-approved td { background: rgba(22, 131, 95, .10); }
tr.row-denied   td { background: rgba(200, 62, 77, .10); }
tbody tr.row-approved:hover td { background: rgba(22, 131, 95, .17); }
tbody tr.row-denied:hover   td { background: rgba(200, 62, 77, .17); }

.status-cell { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }

.status-pill {
  border-radius: 999px;
  padding: 4px 11px;
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-approved { color: #0d674a; background: #e9f8f2; border: 1px solid #c1eadc; }
.status-denied   { color: #a62938; background: #fff0f2; border: 1px solid #f4cad0; }
.status-pending  { color: var(--muted); background: #f1f4f9; border: 1px solid var(--border); }

.status-actions { display: flex; gap: 6px; }
.status-btn {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 11px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  font-size: .74rem;
  white-space: nowrap;
  transition: .15s ease;
}
.status-btn:disabled { opacity: .5; cursor: progress; }
.status-btn.approve:hover, .status-btn.approve.on { color: #0d674a; border-color: #9dd9c3; background: #e9f8f2; }
.status-btn.deny:hover,    .status-btn.deny.on    { color: #a62938; border-color: #f0b8c0; background: #fff0f2; }
.status-btn.on { box-shadow: inset 0 0 0 1px currentColor; }
