/* Shared tokens and the public registration form.
   The staff dashboard adds dashboard.css on top of this file. */

@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-display: swap;
  font-weight: 160 700;
  src: url("../fonts/readex-pro-arabic-wght-normal.d81b2377546d.woff2") format("woff2-variations");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E,
    U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-display: swap;
  font-weight: 160 700;
  src: url("../fonts/readex-pro-latin-wght-normal.aa0c29916314.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  /* Surfaces and ink */
  --canvas: #f1f3ef;
  --frame: #f7f8f5;
  --surface: #ffffff;
  --surface-2: #f6f7f4;
  --line: #e6e9e3;
  --line-2: #d6dbd3;
  --ink: #101814;
  --ink-2: #4f5a54;
  --muted: #626c66;

  /* Brand: forest green, one ramp */
  --g950: #0b2e20;
  --g900: #0f3d2a;
  --g800: #134e35;
  --g700: #1a6644;
  --g600: #23804f;
  --g500: #2f9a62;
  --g300: #8fd0aa;
  --g200: #bfe5cd;
  --g100: #e2f3e8;
  --g50: #f2f9f4;

  /* Status (always paired with an icon and a label) */
  --good-bg: #e6f4e6;
  --good-ink: #006300;
  --warn-bg: #fff3d6;
  --warn-ink: #7a4b00;
  --crit-bg: #fde7e7;
  --crit-ink: #a8201a;
  --neutral-bg: #eef0ee;
  --neutral-ink: #4f5a54;
  --error: #b42318;

  /* Shape */
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 12px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(16, 24, 20, 0.04), 0 12px 32px -18px rgba(16, 24, 20, 0.18);
  --ring: 0 0 0 3px rgba(35, 128, 79, 0.25);

  font-family: "Readex Pro", system-ui, Tahoma, "Segoe UI", sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; line-height: 1.6; background: var(--canvas); color: var(--ink); }
h1, h2, h3 { line-height: 1.3; margin: 0; font-weight: 600; }
h1 { font-size: 1.75rem; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--g700); text-underline-offset: 3px; }
a:hover { color: var(--g900); }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.92em; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.icon { flex: none; display: inline-block; vertical-align: middle; }
/* Arrows and chevrons point the reading direction in right-to-left. */
.icon.flip { transform: scaleX(-1); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

/* --- Brand mark ---------------------------------------------------------- */

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  inline-size: 42px; block-size: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--g800); color: #fff;
  box-shadow: inset 0 0 0 4px var(--g700);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.brand-name { font-weight: 600; font-size: 1rem; color: var(--ink); }
.brand-unit { font-size: 0.78rem; color: var(--muted); }

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-block-size: 42px; padding: 8px 18px;
  border: 1px solid var(--line-2); border-radius: var(--pill);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 0.92rem; font-weight: 500; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--g700); color: var(--g800); }
.btn-primary { background: var(--g800); border-color: var(--g800); color: #fff; }
.btn-primary:hover { background: var(--g900); border-color: var(--g900); color: #fff; }
.btn-light { background: #fff; border-color: #fff; color: var(--g900); }
.btn-light:hover { background: var(--g100); border-color: var(--g100); color: var(--g950); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm { min-block-size: 34px; padding: 5px 14px; font-size: 0.85rem; }
.btn-block { inline-size: 100%; }

/* --- Form controls ------------------------------------------------------- */

input, select, textarea {
  font: inherit; color: var(--ink);
  inline-size: 100%; min-block-size: 44px; padding: 9px 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-block-size: 96px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #b9c1b6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--g600); box-shadow: var(--ring); }
input[dir="ltr"] { text-align: right; }
input[readonly] { background: var(--surface-2); color: var(--ink-2); cursor: default; }
input[readonly]:hover { border-color: var(--line-2); }
input[type="file"] { padding: 7px 10px; background: var(--surface-2); cursor: pointer; }
input[type="file"]::file-selector-button {
  font: inherit; font-size: 0.85rem; margin-inline-end: 12px; padding: 6px 14px;
  border: 0; border-radius: var(--pill); background: var(--g800); color: #fff; cursor: pointer;
}
/* Arabic face for file inputs, added by register.js (see there). */
.file-pick {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-block-size: 46px; padding-block: 6px; padding-inline: 6px 14px;
  border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2);
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.file-pick input[type="file"] { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; opacity: 0; cursor: pointer; }
.file-pick:hover { border-color: var(--g600); background: var(--g50); }
.file-pick:focus-within { border-color: var(--g600); box-shadow: var(--ring); }
.file-pick.has-file { border-style: solid; border-color: var(--g300); background: var(--g50); }
.file-btn {
  flex: none; padding: 6px 14px; border-radius: var(--pill);
  background: var(--g800); color: #fff; font-size: 0.85rem; font-weight: 500;
}
.file-name { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; color: var(--muted); }
.file-pick.has-file .file-name { color: var(--ink); }
.has-error .file-pick { border-color: var(--error); }

input[type="checkbox"], input[type="radio"] { inline-size: auto; min-block-size: 0; accent-color: var(--g700); }
::placeholder { color: #8a948e; }

.field { margin-block-end: 14px; display: flex; flex-direction: column; min-inline-size: 0; }
.field > label { font-size: 0.88rem; font-weight: 500; margin-block-end: 6px; color: var(--ink); }
.field.required > label::after, fieldset.choice.required > legend::after { content: " *"; color: var(--error); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); }
.help { font-size: 0.8rem; color: var(--muted); margin: 6px 0 0; }
.error { font-size: 0.84rem; color: var(--error); margin: 6px 0 0; }

fieldset.choice { border: 0; padding: 0; margin: 0 0 14px; min-inline-size: 0; }
fieldset.choice > legend { font-size: 0.88rem; font-weight: 500; margin-block-end: 8px; padding: 0; }
.choice > div { display: flex; flex-wrap: wrap; gap: 8px; }
.choice > div > div label {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--line-2); border-radius: var(--pill);
  background: var(--surface); cursor: pointer; font-size: 0.9rem;
  transition: border-color 0.15s, background-color 0.15s;
}
.choice > div > div label:hover { border-color: var(--g600); }
.choice > div > div label:has(input:checked) { border-color: var(--g700); background: var(--g100); color: var(--g950); }
.choice input { margin: 0; }

.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { margin-block-start: 5px; inline-size: 18px; block-size: 18px; }

/* --- Notices ------------------------------------------------------------- */

.notices { list-style: none; padding: 0; margin: 0 0 16px; }
.notice {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm); margin-block-end: 12px;
  background: var(--surface); border: 1px solid var(--line);
}
.notice-error { background: var(--crit-bg); border-color: transparent; color: var(--crit-ink); }
.notice-success { background: var(--good-bg); border-color: transparent; color: var(--good-ink); }

/* --- Status badges ------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 12px; border-radius: var(--pill);
  font-size: 0.78rem; font-weight: 500; line-height: 1.5; white-space: nowrap;
  background: var(--neutral-bg); color: var(--neutral-ink);
}
.badge .icon { inline-size: 14px; block-size: 14px; }
.badge-verified, .badge-valid { background: var(--good-bg); color: var(--good-ink); }
.badge-pending, .badge-expired { background: var(--warn-bg); color: var(--warn-ink); }
.badge-rejected { background: var(--crit-bg); color: var(--crit-ink); }

/* --- Public pages -------------------------------------------------------- */

.public-header { background: var(--surface); border-block-end: 1px solid var(--line); }
.public-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.public-header .brand:hover { color: inherit; }

/* The applicant's Google account, at the end of the public header. */
.account { display: flex; align-items: center; gap: 12px; min-inline-size: 0; }
.account-avatar {
  inline-size: 38px; block-size: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--g100); color: var(--g900); font-weight: 600; font-size: 0.85rem;
}
.account-who { display: flex; flex-direction: column; line-height: 1.35; min-inline-size: 0; }
.account-label { font-size: 0.74rem; color: var(--muted); }
.account-email { font-size: 0.86rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: end; }
.account form { margin: 0; }
.wrap { max-inline-size: 1040px; margin-inline: auto; padding-inline: 16px; }
.public-main { padding-block: 32px 64px; }
.public-footer { color: var(--muted); font-size: 0.82rem; padding-block: 20px 32px; }

.hero { margin-block-end: 24px; }
.hero h1 { font-size: 2rem; margin-block-end: 8px; }
.hero p { color: var(--ink-2); max-inline-size: 62ch; }

.section {
  border: 0; margin: 0 0 18px; padding: 22px 24px 10px; min-inline-size: 0;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.section > legend {
  float: inline-start; inline-size: 100%;
  display: flex; align-items: center; gap: 12px;
  font-size: 1.08rem; font-weight: 600; padding: 0; margin-block-end: 18px;
}
.section > legend + * { clear: both; }
.step {
  inline-size: 32px; block-size: 32px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  background: var(--g100); color: var(--g900); font-size: 0.9rem; font-weight: 600;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 20px; }
.declaration { background: var(--g50); box-shadow: inset 0 0 0 1px var(--g200); }
/* A note of its own under a field (the 2026 graduates' alternative). */
.field-note {
  margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 0.86rem; line-height: 1.7;
  background: var(--g50); color: var(--g950); border-inline-start: 3px solid var(--g600);
}

/* "Please wait": over the whole page while the form is being sent. */
.sending {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(11, 46, 32, 0.55);
}
.sending[hidden] { display: none; }
.sending-box {
  display: flex; align-items: center; gap: 16px; max-inline-size: 460px; padding: 22px 26px;
  border-radius: 18px; background: #fff; color: var(--g950); border: 2px solid var(--g700);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.45); outline: none;
}
.sending-box p { margin: 0; font-size: 1.08rem; font-weight: 600; line-height: 1.7; }
.sending-spinner {
  flex: none; inline-size: 34px; block-size: 34px; border-radius: 50%;
  border: 4px solid var(--g100); border-block-start-color: var(--g700);
}
@media (prefers-reduced-motion: no-preference) {
  .sending-spinner { animation: sending-spin 0.9s linear infinite; }
}
@keyframes sending-spin { to { transform: rotate(360deg); } }

.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-block-start: 8px; }
.form-actions .help { margin: 0; }
.hp { position: absolute; inset-inline-start: -10000px; inline-size: 1px; block-size: 1px; overflow: hidden; }

/* The privacy policy: one readable column of text. */
.policy { max-inline-size: 72ch; margin-inline: auto; padding-block: 28px 18px; line-height: 1.8; }
.policy h1 { margin-block-end: 4px; }
.policy h2 { margin-block: 24px 6px; }
.policy p, .policy ul { margin-block: 0 12px; }
.policy ul { padding-inline-start: 22px; }

.confirm { text-align: center; padding: 40px 24px; }
.confirm h1 { margin-block-end: 10px; }
.confirm .confirm-icon {
  inline-size: 64px; block-size: 64px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; background: var(--g100); color: var(--g800);
}
.reference {
  display: inline-block; margin-block-start: 8px; padding: 8px 16px;
  border-radius: var(--pill); background: var(--surface-2); border: 1px dashed var(--line-2);
}
.confirm-note { max-inline-size: 52ch; margin: 22px auto 0; font-size: 0.86rem; color: var(--muted); }
.confirm-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-block-start: 22px; }
.confirm-form { max-inline-size: 360px; margin: 24px auto 0; text-align: start; }

/* Sign in with Google, after Google's light-theme button. */
.gsi-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-block-size: 44px; padding-block: 8px; padding-inline: 14px 20px;
  border: 1px solid #747775; border-radius: var(--pill);
  background: #fff; color: #1f1f1f;
  font-size: 0.92rem; font-weight: 500; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color 0.2s, box-shadow 0.2s;
}
.gsi-btn:hover { background: #f4f7f5; color: #1f1f1f; box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15); }
.gsi-logo { inline-size: 20px; block-size: 20px; flex: none; }

/* Membership pop-up. Without JavaScript the details simply show inline. */

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.88rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.6rem; }
  .section { padding: 18px 16px 6px; border-radius: var(--radius); }
  .public-header .brand-text { display: none; }
  .account-label { display: none; }
  .account .btn span { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .account .btn { padding: 6px; inline-size: 38px; min-block-size: 38px; }
}

/* What an engineer already submitted, shown on a second visit. */
.submitted-title { font-size: 1.05rem; margin-block-end: 14px; }
.submitted { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; }
.submitted dt { color: var(--muted); font-size: 0.88rem; }
.submitted dd { margin: 0; font-weight: 500; }
@media (max-width: 640px) { .submitted { grid-template-columns: 1fr; gap: 2px; } .submitted dd { margin-block-end: 10px; } }

.prewrap { white-space: pre-line; }

/* The syndicate logo is a full round badge: show it whole on white. */
.brand-mark:has(img), .stage-brand .brand-mark:has(img), .auth-panel .brand-mark:has(img) { background: #fff; box-shadow: none; overflow: hidden; }
.brand-mark img { inline-size: 100%; block-size: 100%; display: block; }
.pending-file { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin-block-start: 8px; font-size: 0.85rem; color: var(--muted); }
.pending-file label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
