/* ─────────────────────────────────────────────────────────────────────
   intern-apply.css — /careers/intern-full-stack/
   Extends styles.css (Bloom). Uses the site's tokens only; everything is
   scoped under .ia so nothing leaks into the shared nav/footer.
   ───────────────────────────────────────────────────────────────────── */
.ia {
  --ia-field-line: #998A92;   /* input borders: 3:1 on white (--line is decorative only) */
  --ia-err: #B42318;          /* 6.5:1 on white */
  --ia-progress-h: 62px;
  --ia-fade: 200ms ease;
}

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ia .plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.ia-wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .ia-wrap { padding: 0 28px; } }

.ia-cap, .ia label, .ia .lbl {
  font-family: var(--font-body); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink);
}

/* ── hero ── */
.ia-hero { padding-bottom: 40px; }
.ia-back { display: table; margin: 0 auto 18px; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.ia-back:hover { color: var(--accent); }
.ia-hero h1 { margin-top: 14px; }
.ia-meta { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ia-meta li { font-size: 0.85rem; font-weight: 600; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.ia-meta li:first-child { background: var(--grad-plum); border-color: transparent; color: #fff; }
.ia-cta { margin-top: 28px; }

/* ── summary ── */
.ia-summary details { padding: 0 24px; }
.ia-summary summary { list-style: none; cursor: pointer; padding: 20px 0; display: flex; align-items: baseline; gap: 12px; }
.ia-summary summary::-webkit-details-marker { display: none; }
.ia-summary summary::after { content: "+"; margin-left: 12px; font-size: 1.3rem; line-height: 1; color: var(--accent); }
.ia-summary details[open] summary::after { content: "–"; }
.ia .sum-hint { color: var(--ink-2); font-size: 0.95rem; margin-left: auto; text-align: right; }
.ia .sum-grid { display: grid; gap: 24px; padding: 4px 0 24px; animation: ia-fade var(--ia-fade); }
@media (min-width: 640px) { .ia .sum-grid { grid-template-columns: 1fr 1fr; } }
.ia .sum-h { color: var(--accent); margin-bottom: 10px; }
.ia .sum-grid ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.ia .sum-grid li { margin-bottom: 6px; }
.ia .sum-grid li::marker { color: var(--accent-2); }

/* ── apply intro ── */
.ia-apply { padding: 72px 0 96px; }
#apply-intro { text-align: center; }
#apply-intro h2 { font-size: clamp(2rem, 6vw, 2.8rem); }
.ia .apply-sub { margin-top: 12px; color: var(--ink-2); }

/* ── sticky progress (sits under the fixed site nav) ── */
.ia-progress {
  position: sticky; top: var(--nav-h); z-index: 50; margin-top: 28px;
  background: rgba(252,248,245,0.94); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.ia-progress .ia-wrap { padding-top: 10px; padding-bottom: 10px; }
.ia .steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ia .steps a { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 2px; text-decoration: none; color: var(--ink-2); transition: color var(--ia-fade); }
.ia .steps a:hover, .ia .steps a.on { color: var(--ink); }
.ia .step-k {
  display: inline-grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0;
  border: 1px solid var(--ia-field-line); border-radius: 7px;
  font-size: 0.75rem; font-weight: 700; transition: background var(--ia-fade), color var(--ia-fade), border-color var(--ia-fade);
}
.ia .steps a.on .step-k { border-color: var(--accent); color: var(--accent); }
.ia .steps a.done .step-k { background: var(--accent); border-color: var(--accent); color: #fff; }
.ia .step-l { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ia .step-n { margin-left: auto; font-size: 0.78rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 599px) { .ia .step-l, .ia .step-n { display: none; } .ia .steps a { justify-content: center; } }
.ia-bar { height: 3px; margin-top: 8px; background: var(--line); border-radius: 3px; overflow: hidden; }
#bar-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width var(--ia-fade); }

/* ── status banner ── */
.ia .status { margin-top: 24px; padding: 14px 18px; border-radius: var(--radius-sm); border: 1px solid var(--ia-err); background: #FDF1EF; color: var(--ink); animation: ia-fade var(--ia-fade); }
.ia .status .btn { margin-top: 12px; }

/* ── section cards ── */
.ia .sec { margin-top: 20px; padding: 28px 22px; scroll-margin-top: calc(var(--nav-h) + var(--ia-progress-h) + 12px); }
@media (min-width: 768px) { .ia .sec { padding: 34px 36px; } }
.ia #sec-a { margin-top: 28px; }
.ia .sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px; }
.ia .sec-head .ia-cap { color: var(--accent); }
.ia .sec-head h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; color: var(--ink); }

/* ── fields ── */
.ia .f { margin-bottom: 20px; scroll-margin-top: calc(var(--nav-h) + var(--ia-progress-h) + 24px); }
.ia .row2 { display: grid; gap: 0 18px; }
@media (min-width: 768px) { .ia .row2 { grid-template-columns: 1fr 1fr; } }
.ia label, .ia .lbl { display: block; margin-bottom: 8px; padding: 0; }
.ia label em { font-family: var(--font-display); font-style: italic; text-transform: none; letter-spacing: 0; font-size: 1.05rem; font-weight: 400; color: var(--accent); }
.ia .req { color: var(--accent); }
.ia .opt { color: var(--ink-2); font-weight: 500; letter-spacing: 0.06em; text-transform: lowercase; margin-left: 4px; }
.ia .hint { margin-top: 6px; font-size: 0.86rem; color: var(--ink-2); }

.ia input[type="text"], .ia input[type="email"], .ia input[type="tel"], .ia input[type="url"],
.ia input[type="date"], .ia select, .ia textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--ia-field-line); border-radius: var(--radius-sm);
  transition: border-color var(--ia-fade), box-shadow var(--ia-fade);
  -webkit-appearance: none; appearance: none;
}
.ia textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.ia select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px;
}
.ia input::placeholder, .ia textarea::placeholder { color: #8A7E84; }
.ia input:focus, .ia select:focus, .ia textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(138,78,137,0.16); }
.ia [aria-invalid="true"] { border-color: var(--ia-err) !important; }

.ia .affix { display: flex; align-items: stretch; }
.ia .affix-pre { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--ia-field-line); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--surface-1); color: var(--ink-2); letter-spacing: 0.04em; }
.ia .affix input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.ia .err { color: var(--ia-err); font-size: 0.88rem; font-weight: 500; margin-top: 6px; }
.ia .err:empty { display: none; }
.ia .err:not(:empty) { animation: ia-fade var(--ia-fade); }
.ia .count { margin-top: 6px; color: var(--ink-2); letter-spacing: 0.06em; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.ia .count.ok { color: var(--accent); }

/* radio chips (work mode) + rating pills */
.ia .choice { display: flex; flex-wrap: wrap; gap: 8px; }
.ia .choice label, .ia .pills label { margin: 0; cursor: pointer; letter-spacing: 0; text-transform: none; }
.ia .choice input, .ia .pills input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ia .choice span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--ia-field-line); border-radius: 999px; background: var(--surface-2);
  font-size: 0.95rem; font-weight: 500; color: var(--ink);
  transition: background var(--ia-fade), color var(--ia-fade), border-color var(--ia-fade);
}
.ia .choice label:hover span, .ia .pills label:hover span { border-color: var(--accent); }
.ia .choice input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.ia .choice input:focus-visible + span, .ia .pills input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* upload */
.ia .upload { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px dashed var(--ia-field-line); border-radius: var(--radius-sm); background: var(--bg-0); transition: border-color var(--ia-fade); }
.ia .upload.has { border-style: solid; border-color: var(--accent); }
.ia .upload.bad { border-color: var(--ia-err); }
.ia .up-btn {
  margin: 0; flex-shrink: 0; cursor: pointer; padding: 11px 16px; border-radius: 999px;
  background: var(--surface-1); color: var(--accent); border: 1px solid var(--line-2);
  font-size: 0.9rem; font-weight: 600; letter-spacing: 0; text-transform: none;
  transition: background var(--ia-fade), color var(--ia-fade);
}
.ia .up-btn:hover { background: var(--accent); color: #fff; }
.ia .upload input:focus-visible + .up-btn { outline: 2px solid var(--accent); outline-offset: 3px; }
.ia .up-info { min-width: 0; flex: 1; display: grid; gap: 2px; }
.ia .up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 500; }
.ia .up-info .hint { margin: 0; }
.ia .up-bar { height: 4px; margin-top: 6px; background: var(--line); border-radius: 4px; overflow: hidden; }
#up-fill { display: block; height: 100%; width: 0; background: var(--accent); transition: width 120ms linear; }

/* skills */
.ia .banner { padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--surface-1); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-bottom: 18px; color: var(--ink); }
.ia .banner strong { font-weight: 600; }
.ia .legend-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; padding: 10px 0; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ia .legend-bar span { text-transform: none; letter-spacing: 0.01em; font-weight: 500; font-size: 0.8rem; color: var(--ink-2); white-space: nowrap; }
.ia .legend-bar b { color: var(--accent); font-weight: 700; margin-right: 4px; }
@media (max-width: 767px) { .ia .legend-bar { position: sticky; top: calc(var(--nav-h) + var(--ia-progress-h)); z-index: 10; } }
@media (min-width: 768px) { .ia .legend-bar { grid-template-columns: repeat(4, auto); justify-content: space-between; } }

.ia .skill { border: 0; margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; align-items: center; scroll-margin-top: calc(var(--nav-h) + var(--ia-progress-h) + 70px); }
@media (min-width: 560px) { .ia .skill { grid-template-columns: 1fr auto; } }
.ia .skill legend { float: left; width: 100%; padding: 0; font-weight: 500; font-size: 1rem; color: var(--ink); }
@media (min-width: 560px) { .ia .skill legend { width: auto; } }
.ia .skill .err { grid-column: 1 / -1; margin: 0; }
.ia .pills { display: flex; gap: 8px; }
.ia .pills span {
  display: grid; place-items: center; width: 48px; height: 44px;
  border: 1px solid var(--ia-field-line); border-radius: 999px; background: var(--surface-2);
  font-size: 1rem; font-weight: 600; color: var(--ink);
  transition: background var(--ia-fade), color var(--ia-fade), border-color var(--ia-fade);
}
.ia .pills input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.ia .skill[aria-invalid="true"] .pills span { border-color: var(--ia-err); }
.ia .nudge { margin-top: 16px; padding: 12px 16px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface-1); color: var(--accent); font-weight: 600; animation: ia-fade var(--ia-fade); }

/* declaration */
.ia .check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 500; color: var(--ink); }
.ia .check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }

.ia .hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.ia .captcha { margin: 8px 0 12px; }

/* submit */
.ia .ia-submit { width: 100%; justify-content: center; margin-top: 28px; min-height: 54px; font-size: 1rem; }
@media (min-width: 768px) { .ia .ia-submit { width: auto; min-width: 280px; } }
.ia .ia-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.ia .spin { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: ia-spin 0.8s linear infinite; }
.ia .ia-submit.busy .spin { display: inline-block; }
.ia .fine { margin-top: 16px; font-size: 0.85rem; color: var(--ink-2); }
.ia .fine a { color: var(--accent); }

/* submit → success hand-off */
.ia .ia-submit.done, .ia .ia-submit.done:disabled { opacity: 1; background: var(--grad-plum); }
.ia form.leaving { opacity: 0; transform: translateY(-10px); transition: opacity 450ms ease, transform 450ms ease; pointer-events: none; }

/* success */
.ia .success { margin-top: 28px; padding: 44px 28px 40px; text-align: center; outline: none; overflow: hidden; }
.ia .success h2 { margin-top: 10px; font-size: clamp(1.9rem, 6vw, 2.6rem); }
.ia .success-note {
  display: inline-block; margin: 0; padding: 8px 16px; border-radius: 999px;
  background: rgba(138,78,137,0.10); color: var(--accent); font-weight: 700; font-size: 1rem;
}
.ia .success-mark { position: relative; width: 96px; height: 96px; margin: 0 auto 18px; }
.ia .success-mark svg { position: relative; width: 96px; height: 96px; overflow: visible; }
.ia .success-mark .ring { fill: rgba(138,78,137,0.08); stroke: url(#okGrad); stroke-width: 4; stroke-dasharray: 227; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: 40px 40px; }
.ia .success-mark .tick { fill: none; stroke: url(#okGrad); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 0; }
.ia .burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.ia .burst i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; opacity: 0; transform: rotate(var(--a)) translateY(0); }
.ia .burst i:nth-child(4n+1) { background: var(--accent); }
.ia .burst i:nth-child(4n+2) { background: var(--accent-2); }
.ia .burst i:nth-child(4n+3) { background: var(--gold); }
.ia .burst i:nth-child(4n+4) { background: var(--accent-3); }
.ia .burst i:nth-child(1) { --a: 0deg; }   .ia .burst i:nth-child(2) { --a: 36deg; }
.ia .burst i:nth-child(3) { --a: 72deg; }  .ia .burst i:nth-child(4) { --a: 108deg; }
.ia .burst i:nth-child(5) { --a: 144deg; } .ia .burst i:nth-child(6) { --a: 180deg; }
.ia .burst i:nth-child(7) { --a: 216deg; } .ia .burst i:nth-child(8) { --a: 252deg; }
.ia .burst i:nth-child(9) { --a: 288deg; } .ia .burst i:nth-child(10) { --a: 324deg; }

.ia .success.play { animation: ia-rise 500ms cubic-bezier(.2,.8,.2,1) both; }
.ia .success.play .success-mark svg { animation: ia-pop 520ms cubic-bezier(.3,1.5,.5,1) 150ms both; }
.ia .success.play .ring { animation: ia-draw-ring 620ms ease-out 200ms both; }
.ia .success.play .tick { animation: ia-draw-tick 380ms ease-out 720ms both; }
.ia .success.play .burst i { animation: ia-burst 800ms cubic-bezier(.2,.8,.2,1) 820ms both; }
.ia .success.play > :not(.success-mark) { animation: ia-rise 460ms ease-out both; }
.ia .success.play > :nth-child(2) { animation-delay: 950ms; }
.ia .success.play > :nth-child(3) { animation-delay: 1080ms; }
.ia .success.play > :nth-child(4) { animation-delay: 1180ms; }
.ia .success.play > :nth-child(5) { animation-delay: 1260ms; }
.ia .success.play > :nth-child(6) { animation-delay: 1340ms; }
.ia .success > p { margin: 16px auto 0; color: var(--ink-2); max-width: 52ch; }
.ia .success .app-id { margin-top: 22px; }
.ia .success .app-id #app-id { color: var(--ink); font-weight: 600; letter-spacing: 0.02em; word-break: break-all; }
.ia .success .btn { margin-top: 24px; }

@keyframes ia-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ia-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes ia-pop { from { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.08); } to { opacity: 1; transform: scale(1); } }
@keyframes ia-draw-ring { from { stroke-dashoffset: 227; } to { stroke-dashoffset: 0; } }
@keyframes ia-draw-tick { from { stroke-dashoffset: 50; } to { stroke-dashoffset: 0; } }
@keyframes ia-burst {
  0%   { opacity: 0; transform: rotate(var(--a)) translateY(-30px) scale(.4); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-66px) scale(1); }
}
@keyframes ia-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ia *, .ia *::before, .ia *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  .ia .burst { display: none; }
}
