/* ALI Careers. Follows aliremote.com: white, Apple-style type, blue pill buttons.
   The hero takes its navy-to-blue from the ALI app icon. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #424245;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --accent: #0f76b8;
  --accent-hover: #0c659f;
  --accent-soft: #e6f1f9;
  --accent-text: #ffffff;
  --danger: #d70015;
  --danger-soft: #fff0f1;
  --success: #1a7f37;
  --hero-1: #050b16;
  --hero-2: #0b2343;
  --hero-3: #1b5fa8;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 40px rgba(15,40,80,.10);
  --radius: 22px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, system-ui, sans-serif;
  color-scheme: light;
  /* names the admin page uses */
  --card: var(--surface);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #161618; --surface-2: #1f1f22; --text: #f5f5f7; --text-2: #d2d2d7;
    --muted: #98989d; --line: #3a3a3e; --line-soft: #2a2a2d; --accent: #3a9be0; --accent-hover: #5aafea;
    --accent-soft: #0d2a40; --danger: #ff6961; --danger-soft: #3a1416; --success: #3fb950;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 40px rgba(0,0,0,.5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #161618; --surface-2: #1f1f22; --text: #f5f5f7; --text-2: #d2d2d7;
  --muted: #98989d; --line: #3a3a3e; --line-soft: #2a2a2d; --accent: #3a9be0; --accent-hover: #5aafea;
  --accent-soft: #0d2a40; --danger: #ff6961; --danger-soft: #3a1416; --success: #3fb950;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 40px rgba(0,0,0,.5); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.47 var(--font); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* ---------- wordmark ---------- */
.wordmark {
  display: inline-block; width: 55px; height: 26px; background: currentColor;
  -webkit-mask: url(/ali-logo.svg) no-repeat center / contain; mask: url(/ali-logo.svg) no-repeat center / contain;
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(120% 90% at 85% 110%, color-mix(in srgb, var(--hero-3) 85%, transparent) 0%, transparent 60%),
    radial-gradient(70% 60% at 10% 0%, rgba(120,170,230,.18) 0%, transparent 70%),
    linear-gradient(170deg, var(--hero-1) 0%, var(--hero-2) 55%, #123d6e 100%);
  padding: 20px 16px 120px;
}
.hero::after { /* soft ring echoing the icon's eye */
  content: ""; position: absolute; width: 520px; height: 520px; right: -160px; top: -120px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.08); box-shadow: inset 0 0 0 60px rgba(255,255,255,.02);
  pointer-events: none;
}
.nav { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand .tag { font-size: 15px; font-weight: 500; color: rgba(255,255,255,.7); padding-left: 10px; border-left: 1px solid rgba(255,255,255,.25); }
.nav-link { color: rgba(255,255,255,.85); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-link:hover { color: #fff; }
.hero-inner { max-width: 720px; margin: 0 auto; text-align: center; padding-top: 56px; position: relative; z-index: 1; }
.app-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.12); }
.eyebrow { display: inline-block; margin: 22px 0 0; padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; letter-spacing: .02em; background: rgba(255,255,255,.1); color: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.15); }
.hero h1 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05;
  font-size: clamp(38px, 7vw, 64px); margin: 16px 0 0; text-wrap: balance;
}
.hero h1 .glow { background: linear-gradient(90deg, #9fd0ff, #5fb0ff 60%, #8fd3f6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.sub { margin: 18px auto 0; max-width: 560px; font-size: clamp(17px, 2.2vw, 20px); line-height: 1.45; color: rgba(255,255,255,.78); text-wrap: pretty; }

/* ---------- steps ---------- */
.steps { list-style: none; padding: 0; margin: 36px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 780px; }
.steps li { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); font-size: 14px; line-height: 1.3; color: rgba(255,255,255,.9); }
.steps b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: #fff; color: var(--hero-2); }
@media (max-width: 560px) {
  .hero { padding-bottom: 104px; }
  .hero-inner { padding-top: 28px; }
  .app-icon { width: 56px; height: 56px; border-radius: 14px; }
  .eyebrow { margin-top: 16px; }
  .hero p.sub { margin-top: 14px; }
  .steps { grid-template-columns: 1fr; max-width: 340px; gap: 6px; margin-top: 24px; }
  .steps li { padding: 9px 12px; }
}

/* ---------- form card ---------- */
.main { padding: 0 16px 64px; }
.card {
  position: relative; max-width: 680px; margin: -84px auto 0; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line-soft); padding: 36px 40px 40px;
}
@media (max-width: 600px) { .card { padding: 24px 18px 28px; border-radius: 18px; } }
.card-head h2 { font-family: var(--font-display); font-size: 28px; letter-spacing: -0.025em; margin: 0; }
.card-head p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

fieldset { border: 0; padding: 0; margin: 28px 0 0; min-width: 0; }
legend { display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 14px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); width: 100%; }
legend::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } .grid .span-2 { grid-column: auto; } }

.field { display: grid; gap: 6px; align-content: start; }
.field > span { font-size: 14px; font-weight: 600; color: var(--text-2); }
.field > span .req { color: var(--accent); margin-left: 2px; }
.field > span .opt { color: var(--muted); font-weight: 400; }
.hint { font-size: 13px; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: 17px; letter-spacing: -0.01em; color: var(--text); width: 100%;
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
select {
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2386868b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--text) 30%, var(--line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.field.invalid input, .field.invalid textarea, .field.invalid select, input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 14%, transparent); }
.field-error { font-size: 13px; color: var(--danger); display: none; }
.field.invalid .field-error { display: block; }

/* segmented choice for English level */
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; width: 1px; }
.segmented label { text-align: center; padding: 10px 6px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; user-select: none; }
.segmented label:hover { color: var(--text); }
.segmented input:checked + label { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 1px var(--line-soft); }
.segmented input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
@media (max-width: 460px) { .segmented { grid-template-columns: 1fr 1fr; } }

.consent { display: flex; gap: 12px; align-items: flex-start; margin-top: 28px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); font-size: 14px; line-height: 1.45; color: var(--text-2); cursor: pointer; }
.consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; padding: 0; border-radius: 6px; border: 1.5px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.consent input:checked { background: var(--accent); border-color: var(--accent); }
.consent input:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.consent.invalid { box-shadow: 0 0 0 1.5px var(--danger) inset; background: var(--danger-soft); }

.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- buttons ---------- */
button, .button {
  font: inherit; font-size: 17px; font-weight: 500; letter-spacing: -0.01em; border: 0; cursor: pointer;
  padding: 13px 26px; border-radius: 999px; background: var(--accent); color: var(--accent-text);
  transition: background .15s, transform .1s, opacity .15s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button:hover { background: var(--accent-hover); }
button:active { transform: scale(.98); }
button:disabled { opacity: .55; cursor: default; transform: none; }
.submit-row { margin-top: 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.submit-row button { min-width: 220px; padding: 15px 28px; }
.submit-row .hint { flex: 1; min-width: 180px; }
@media (max-width: 560px) { .submit-row button { width: 100%; } }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; display: none; }
button.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.error { margin: 20px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 15px; }
.error[hidden] { display: none; }

/* ---------- done ---------- */
.done { text-align: center; padding: 24px 0 8px; }
.done[hidden] { display: none; }
.check-circle { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--success) 14%, transparent); }
.check-circle svg { width: 38px; height: 38px; stroke: var(--success); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .15s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done h2 { font-family: var(--font-display); font-size: 30px; letter-spacing: -0.025em; margin: 20px 0 6px; }
.done p { color: var(--muted); margin: 0 auto; max-width: 420px; }
@media (prefers-reduced-motion: reduce) { .check-circle svg { animation: none; stroke-dashoffset: 0; } .spinner { animation-duration: 2s; } }

/* ---------- footer ---------- */
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 0 16px 40px; }
.foot a { color: inherit; }

/* ---------- login page ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(120% 80% at 80% 110%, color-mix(in srgb, var(--hero-3) 70%, transparent), transparent 60%),
  linear-gradient(170deg, var(--hero-1), var(--hero-2) 60%, #123d6e); }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--radius); padding: 32px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.auth-card .app-icon { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.auth-card h1 { font-family: var(--font-display); font-size: 24px; letter-spacing: -0.02em; margin: 16px 0 4px; }
.auth-card p.lead { color: var(--muted); font-size: 15px; margin: 0 0 22px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card button { width: 100%; margin-top: 6px; }
.auth-card .error { margin: 0; }
