/* AVApply for job seekers (web). Same design system as the Android app, the team panel and
   avapply.in: logo navy + red, Poppins, rounded shapes. Phone-first; on a computer the pages
   widen into two columns and the tabs move into the top bar. */
:root {
  --bg: #f4f6fb; --surface: #ffffff; --ink: #0f1b3d; --muted: #6b7489; --line: #e4e8f1;
  --brand: #0b2a6b; --brand-ink: #ffffff; --red: #e41826;
  --bar: linear-gradient(135deg, #061a45 0%, #0b2a6b 55%, #1e4ba8 100%);
  --shadow: 0 8px 24px rgba(11, 42, 107, 0.08);
  --focus: 0 0 0 3px rgba(30, 75, 168, 0.35);
  --marigold-soft: #fff1d6; --chip: #f1f4fa;
  --ok: #15803d; --warn: #8f5b00; --danger: #c62828;
  --radius: 14px; --radius-lg: 18px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070d1f; --surface: #111a33; --ink: #e8ecf7; --muted: #9da7c2; --line: #223055;
    --brand: #8fb0ff; --brand-ink: #061a45; --red: #ff5a64; --shadow: none;
    --focus: 0 0 0 3px rgba(143, 176, 255, 0.45);
    --marigold-soft: #3a2a0a; --chip: #151f3b;
    --ok: #4ade80; --warn: #f59e0b; --danger: #ff7a82;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }
h1, h2, h3 { font-weight: 700; line-height: 1.25; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.err { color: var(--danger); white-space: pre-line; font-size: 0.9rem; min-height: 1.2em; }
.ok { color: var(--ok); font-weight: 600; }
.opt { font-weight: 400; color: var(--muted); font-size: 0.8rem; }

/* Buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border-radius: var(--radius);
  border: 1.5px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none; transition: filter 0.15s;
}
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--brand); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #ffffff; }
.btn.ghost.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 0.9rem; }
.btn.white { background: #ffffff; color: #0b2a6b; border-color: #ffffff; align-self: flex-start; }
.link { background: none; border: 0; padding: 6px 0; color: var(--brand); font-weight: 600; cursor: pointer; justify-self: start; }
.link.light { color: #ffffff; }
.pill-btn { min-height: 40px; padding: 0 14px; border: 1.5px solid rgba(255, 255, 255, 0.6); border-radius: 999px; font-size: 0.9rem; font-weight: 500; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; min-height: 50px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
textarea { min-height: 110px; resize: vertical; }
label, .lbl { font-weight: 600; font-size: 0.95rem; }
.tel { display: flex; align-items: stretch; }
.tel span { display: grid; place-items: center; padding: 0 14px; border: 1.5px solid var(--line); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--chip); font-weight: 600; }
.tel input { border-radius: 0 var(--radius) var(--radius) 0; }
.row-between { display: flex; justify-content: space-between; gap: 12px; }

/* Splash */
.splash { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--bar); color: #ffffff; }
.splash img { border-radius: 22px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); }
.splash p { font-size: 1.6rem; font-weight: 700; }

/* Sign-in: navy hero with the logo, then a rounded panel (as in the app). */
.signin { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bar); }
.signin-hero { text-align: center; color: #ffffff; padding: 48px 20px 36px; }
.hero-logo { border-radius: 22px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); }
.signin-hero h1 { font-size: 1.9rem; margin-top: 14px; }
.signin-hero p { color: rgba(255, 255, 255, 0.78); margin-top: 4px; }
.signin-panel { flex: 1; background: var(--bg); border-radius: 32px 32px 0 0; padding: 28px 24px 32px; display: grid; gap: 14px; align-content: start; }
.signin-panel > * { width: min(440px, 100%); margin-inline: auto; }
.signin-panel h2 { font-size: 1.4rem; }
.signin-panel form { display: grid; gap: 12px; }
@media (min-width: 720px) {
  .signin { display: grid; place-content: center; padding: 32px; }
  .signin-hero { padding-top: 0; }
  .signin-panel { flex: none; width: 480px; border-radius: 28px; padding: 32px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); }
}

.center-page { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.card.narrow { width: min(460px, 100%); }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 5; background: var(--bar); color: #ffffff;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: 0 6px 20px rgba(6, 26, 69, 0.25);
  display: flex; align-items: center; gap: 12px 20px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.logo .tile { width: 36px; height: 36px; border-radius: 10px; }
.bar-title { flex: 1; font-size: 1rem; font-weight: 600; opacity: 0.9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .tabs { flex: 1; }

.page { width: min(1080px, 100%); margin: 0 auto; padding: 20px 16px 32px; display: grid; gap: 16px; align-content: start; }

/* Registration */
.register { min-height: 100dvh; display: flex; flex-direction: column; }
.register .page { flex: 1; width: min(640px, 100%); }
.progress { height: 5px; margin: 8px 16px 0; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--red); border-radius: 3px; transition: width 0.25s; }
.step-no { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; color: var(--brand); }
.step-title { font-size: 1.5rem; }
#reg-form { display: grid; gap: 14px; }
.f { display: grid; gap: 6px; min-width: 0; }
.f .msg { font-size: 0.82rem; color: var(--muted); min-height: 0; }
.f.bad .msg { color: var(--danger); }
.f.bad input, .f.bad select, .f.bad textarea { border-color: var(--danger); }
.f.bad .chips label { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 16px; font-weight: 500; cursor: pointer; background: var(--surface); }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.chips label:has(input:checked) { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.chips label:has(input:checked)::before { content: "✓"; font-weight: 700; }
.chips label:has(input:focus-visible) { box-shadow: var(--focus); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.switch-row > span { display: grid; font-weight: 400; }
.switch-row input { appearance: none; flex: none; width: 52px; height: 30px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background 0.15s; margin: 0; }
.switch-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: left 0.15s; }
.switch-row input:checked { background: var(--brand); }
.switch-row input:checked::after { left: 25px; }
.reg-foot { position: sticky; bottom: 0; display: flex; gap: 12px; padding: 14px 16px; padding-bottom: max(14px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.reg-foot .btn { flex: 1; }
#reg-next { flex: 2; }
@media (min-width: 720px) { .reg-foot { justify-content: center; } .reg-foot .btn { flex: 0 1 220px; } #reg-next { flex: 0 1 300px; } }

/* Photos: passport shape (25 × 32) */
.photo { position: relative; flex: none; display: inline-grid; place-items: center; overflow: hidden; background: var(--chip); color: var(--muted); border-radius: 10px; aspect-ratio: 25 / 32; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo .none { font-size: 0.8rem; text-align: center; padding: 4px; }
.photo.mid { width: 84px; }
.photo.big { width: 112px; }
.photo-pick { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.photo-pick .photo.big { width: 160px; border: 1.5px solid var(--line); border-radius: 14px; }
.photo-pick.bad .photo.big { border: 2px solid var(--danger); }
.photo-btns { display: grid; gap: 10px; flex: 1; min-width: 200px; }

/* Crop and camera dialogs */
dialog { border: 0; border-radius: 24px; padding: 20px; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgb(0 0 0 / 0.55); }
.crop-dlg { width: min(420px, calc(100% - 24px)); display: grid; gap: 12px; }
.crop-dlg[open] { display: grid; }
.crop-frame { width: min(300px, 70vw); aspect-ratio: 25 / 32; margin: 0 auto; border-radius: 12px; overflow: hidden; background: #000; touch-action: none; }
.crop-frame canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.crop-tools { display: flex; align-items: center; gap: 10px; }
.crop-tools input[type=range] { flex: 1; accent-color: var(--brand); }
.crop-foot { display: flex; gap: 10px; justify-content: flex-end; }
.cam { width: 100%; border-radius: 12px; background: #000; transform: scaleX(-1); }

/* Home tabs: bottom navigation on phones, in the top bar on computers. */
.tabs { display: flex; gap: 6px; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; color: inherit; opacity: 0.85; font-weight: 500; font-size: 0.95rem; background: transparent; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 999px; cursor: pointer; }
.tabs button[aria-current="true"] { opacity: 1; font-weight: 600; background: #ffffff; color: #0b2a6b; border-color: #ffffff; }
.tabs .ico { width: 18px; height: 18px; fill: currentColor; flex: none; }
@media (max-width: 719px) {
  #home .bar .logo { flex: 1; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; justify-content: space-around; gap: 0;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px; padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
  .tabs button { flex: 1; flex-direction: column; gap: 2px; border: 0; color: var(--muted); opacity: 1; font-size: 0.78rem; padding: 6px 4px; border-radius: 16px; }
  .tabs button[aria-current="true"] { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); border: 0; }
  .tabs .ico { width: 24px; height: 24px; }
  #home .page { padding-bottom: 96px; }
}

/* Cards and content */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; display: grid; gap: 12px; }
.hello { font-size: clamp(1.5rem, 4vw, 2rem); }
.sec { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.sec::before { content: ""; flex: none; width: 4px; height: 1.1em; border-radius: 2px; background: var(--red); }
.grp { font-size: 1rem; color: var(--brand); }
.grid2 { display: grid; gap: 16px; align-items: start; }
.col { display: grid; gap: 16px; min-width: 0; align-content: start; }
@media (min-width: 900px) { .grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; } }
.list { display: grid; gap: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1 1 220px; }

/* Photo beside the ID; on a narrow phone the ID moves below the photo so it is never cut. */
.id-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; min-width: 0; }
.id-row > div { flex: 1 1 220px; min-width: 0; display: grid; gap: 6px; }
.idcard { border-left: 5px solid var(--red); padding-left: 14px; display: grid; gap: 2px; justify-items: start; min-width: 0; }
.idcard .cap { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.avaid { font-size: clamp(1.05rem, 5vw, 1.45rem); font-weight: 600; color: var(--brand); white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.name { font-size: 1.3rem; }
.pill { font-size: 0.72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.pill.new { background: var(--chip); color: var(--muted); }
.pill.contacted { background: var(--marigold-soft); color: var(--warn); }
.pill.interview { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.pill.placed { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }

.track { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.track li { display: flex; gap: 14px; align-items: center; color: var(--muted); }
.track li > span:last-child { display: grid; }
.track .dot { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); font-weight: 700; font-size: 0.9rem; }
.track li.done { color: var(--ink); }
.track li.done .dot { background: var(--ok); color: #ffffff; }
.track li b { font-weight: 500; }
.track li.now b { font-weight: 700; }

.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; }
.ticks li::before { content: "✓"; color: var(--brand); font-weight: 700; }
.email { color: var(--brand); font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }

.av-banner { display: grid; gap: 12px; padding: 20px; border-radius: var(--radius-lg); background: var(--bar); color: #ffffff; text-decoration: none; }
.av-head { display: flex; align-items: center; gap: 12px; }
.av-head img { border-radius: 12px; }
.av-head > span { display: grid; }
.av-head b { font-size: 1.2rem; }
.av-head span span { color: rgba(255, 255, 255, 0.75); font-size: 0.85rem; }

.course { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; color: var(--ink); text-decoration: none; transition: border-color 0.15s; }
.course:hover { border-color: var(--brand); }
.course > span:first-child { display: grid; gap: 2px; min-width: 0; }
.course .go { flex: none; color: var(--brand); font-weight: 600; font-size: 0.9rem; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.free { justify-self: start; margin-top: 4px; font-size: 0.78rem; font-weight: 600; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); border-radius: 999px; padding: 2px 10px; }

dl.facts { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px 20px; margin: 8px 0 0; }
dl.facts dt { color: var(--muted); font-size: 0.9rem; }
dl.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 600px) { dl.facts { grid-template-columns: minmax(0, 1fr); gap: 0; } dl.facts dd { margin-bottom: 10px; } }
.confirm { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }

.btn.install { margin-top: 4px; }
.install-dlg { width: min(440px, calc(100% - 24px)); display: grid; gap: 12px; }
.install-dlg[open] { display: grid; }
.install-dlg .btn { justify-self: end; min-width: 120px; }
@media (max-width: 719px) { #home .bar [data-install] { display: none; } }

#toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); background: #061a45; color: #ffffff; padding: 12px 18px; border-radius: 12px; z-index: 20; width: max-content; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
@media (min-width: 720px) { #toast { bottom: 28px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.link:disabled { color: var(--muted); cursor: default; }
.install-dlg p { margin: 0; }

/* Sign in: "I have a password" / "New here" switch, password fields */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--chip); border-radius: 999px; }
.seg button { font-size: 0.9rem; white-space: nowrap; padding: 0 8px; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--brand); box-shadow: 0 2px 8px rgba(11, 42, 107, 0.12); }
.pw { position: relative; display: flex; }
.pw input { padding-right: 72px; }
.pw .link { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 0.85rem; padding: 6px; }
.note { background: var(--chip); border-radius: var(--radius); padding: 12px 14px; font-size: 0.9rem; }
#setpw form { display: grid; gap: 10px; }
#setpw h2 { font-size: 1.35rem; }
.mobile-line { font-size: 0.95rem; }
#chpw { display: grid; gap: 10px; }
#chpw[hidden] { display: none; }

/* "Get the AVApply app" pop-up (web/install.js) */
.install-popup { text-align: center; justify-items: center; width: min(400px, calc(100% - 24px)); padding: 28px 24px 18px; }
.install-popup img { border-radius: 16px; box-shadow: var(--shadow); }
.install-popup h2 { font-size: 1.35rem; }
.install-popup .popup-body { display: grid; gap: 12px; justify-items: stretch; width: 100%; }
.install-popup .btn.big { min-height: 56px; font-size: 1.1rem; width: 100%; }
.install-popup .link { justify-self: center; color: var(--muted); font-weight: 500; }
.steps-box { text-align: left; background: var(--chip); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 4px; }
