/* ================================================================
   FINNEX CAREERS — Design System & Styles
   Mobile-first. Base: 360px → Tablet: 768px → Desktop: 1280px
   Font: Lexend (Google Fonts)
   ================================================================ */

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens ──────────────────────────────────────────────── */
:root {
  /* Brand palette */
  --cyan:        #00b9fe;
  --blue:        #0383e6;
  --deep:        #005acf;
  --ink:         #0b1430;
  --slate:       #5b6577;
  --slate-lt:    #8a94a6;
  --bg:          #eef2f8;
  --card:        #ffffff;
  --border:      #d4dce8;
  --error:       #d8344c;
  --error-bg:    #fff1f3;
  --success:     #0a8f5c;
  --success-bg:  #edfaf5;

  /* Gradients */
  --grad:        linear-gradient(135deg, var(--cyan) 0%, var(--blue) 50%, var(--deep) 100%);
  --grad-r:      linear-gradient(135deg, var(--deep) 0%, var(--blue) 50%, var(--cyan) 100%);

  /* Fluid type scale */
  --t-xs:   clamp(0.68rem, 1.8vw, 0.75rem);
  --t-sm:   clamp(0.78rem, 2.2vw, 0.875rem);
  --t-base: clamp(0.88rem, 2.5vw, 1rem);
  --t-lg:   clamp(1rem,    3vw,   1.125rem);
  --t-xl:   clamp(1.1rem,  3.5vw, 1.25rem);
  --t-2xl:  clamp(1.25rem, 4.5vw, 1.5rem);
  --t-3xl:  clamp(1.5rem,  6vw,   2rem);
  --t-hero: clamp(2rem,    8vw,   3.4rem);

  /* Spacing */
  --sp1: 0.25rem; --sp2: 0.5rem;  --sp3: 0.75rem; --sp4: 1rem;
  --sp5: 1.25rem; --sp6: 1.5rem;  --sp8: 2rem;    --sp10: 2.5rem;
  --sp12: 3rem;   --sp16: 4rem;

  /* Radii */
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 24px; --r-full: 9999px;

  /* Shadows */
  --sh-sm:   0 1px 3px rgba(11,20,48,.07), 0 1px 2px rgba(11,20,48,.04);
  --sh-md:   0 4px 16px rgba(11,20,48,.09), 0 2px 6px rgba(11,20,48,.04);
  --sh-lg:   0 12px 40px rgba(11,20,48,.13), 0 4px 16px rgba(11,20,48,.06);
  --sh-card: 0 2px 0 rgba(255,255,255,.9) inset, 0 8px 32px rgba(11,20,48,.1);
  --sh-focus: 0 0 0 3px rgba(0,185,254,.28);
  --sh-btn:  0 4px 20px rgba(3,131,230,.38);
  --sh-btn-h:0 6px 28px rgba(3,131,230,.5);

  /* Easing */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .blob { animation: none !important; }
}

/* ── Base ───────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body, input, textarea, select, button {
  font-family: 'Lexend', system-ui, sans-serif;
}

body {
  font-size: var(--t-base);
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Background mesh ────────────────────────────────────────────── */
.bg-mesh {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}

.blob {
  position: absolute; border-radius: 50%;
  filter: blur(120px); opacity: 0;
  will-change: transform;
}
.blob-1 {
  width: min(700px, 140vw); height: min(700px, 140vw);
  background: radial-gradient(circle, rgba(0,185,254,.3) 0%, transparent 70%);
  top: -160px; left: -100px;
  animation: drift1 16s ease-in-out infinite;
}
.blob-2 {
  width: min(850px, 160vw); height: min(850px, 160vw);
  background: radial-gradient(circle, rgba(3,131,230,.25) 0%, transparent 70%);
  top: 25%; right: -200px;
  animation: drift2 20s ease-in-out infinite;
}
.blob-3 {
  width: min(600px, 120vw); height: min(600px, 120vw);
  background: radial-gradient(circle, rgba(0,90,207,.2) 0%, transparent 70%);
  bottom: -100px; left: 15%;
  animation: drift3 12s ease-in-out infinite;
}

@keyframes drift1 {
  0%,100% { transform: translate(0,0) scale(0.9); }
  33% { transform: translate(90px,50px) scale(1.2); }
  66% { transform: translate(-50px,80px) scale(0.85); }
}
@keyframes drift2 {
  0%,100% { transform: translate(0,0) scale(0.95); }
  40% { transform: translate(-100px,70px) scale(1.18); }
  70% { transform: translate(60px,-50px) scale(0.8); }
}
@keyframes drift3 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-70px,-80px) scale(1.22); }
}

/* ── Splash ─────────────────────────────────────────────────────── */
.splash {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .38s ease, visibility .38s ease;
}
.splash.out { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-inner {
  display: flex; align-items: center; gap: var(--sp4);
}
.splash-logo-3d {
  width: 120px;
  height: 120px;
  object-fit: contain;
  display: block;
  animation: float3d 3.5s ease-in-out infinite;
}

@keyframes float3d {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ── App shell ──────────────────────────────────────────────────── */
.app {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  /* massive bottom padding to ensure form scrolls above mobile keyboard */
  padding-bottom: 50vh;
}

/* ── Header ─────────────────────────────────────────────────────── */
.site-header {
  position: relative; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp3) var(--sp5);
  background: transparent;
  border-bottom: none;
}

.logo-link {
  display: flex; align-items: center;
  text-decoration: none;
}
.header-logo-img {
  height: 73px;
  width: auto;
  display: block;
  /* Knock out white background so it blends with the frosted header */
  mix-blend-mode: multiply;
}

.admin-link {
  background: none; border: none;
  font-family: inherit; font-size: var(--t-xs);
  color: var(--slate); cursor: pointer;
  padding: var(--sp2) var(--sp3);
  border-radius: var(--r-sm);
  min-height: 44px; min-width: 44px;
  transition: color .15s, background .15s;
}
.admin-link:hover { color: var(--ink); background: rgba(11,20,48,.05); }
.admin-link:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
  padding: var(--sp10) var(--sp5) var(--sp6);
  max-width: 720px; margin: 0 auto; width: 100%;
}

.team-seats {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: var(--sp5);
  opacity: 0; /* GSAP entry target */
}
.seat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.seat-dot.active {
  background: var(--slate-lt);
}
.seat-dot.open {
  border: 1.5px solid var(--cyan);
  background: transparent;
  animation: pulse-seat 2.2s infinite ease-in-out;
}
.seat-label {
  font-size: var(--t-xs); font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase;
  color: var(--slate); margin-left: var(--sp1);
}
@keyframes pulse-seat {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.22); opacity: 1; background: rgba(0, 185, 254, 0.25); }
}

.hero-title {
  font-size: var(--t-hero); font-weight: 800;
  line-height: 1.08; letter-spacing: -0.03em;
  color: var(--ink); margin-bottom: var(--sp4);
}
.hero-title .word {
  display: inline-block;
  opacity: 0; transform: translateY(110%); /* GSAP entry targets */
  margin-right: .22em;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: var(--t-lg); color: var(--slate);
  font-weight: 400; line-height: 1.65;
  max-width: 500px;
  opacity: 0; /* GSAP target */
}

/* ── Form container ─────────────────────────────────────────────── */
.form-container {
  flex: 1; padding: 0 var(--sp4) var(--sp8);
  max-width: 620px; margin: 0 auto; width: 100%;
}

/* ── Progress bar ───────────────────────────────────────────────── */
.progress-wrap {
  margin-bottom: var(--sp5);
  opacity: 0; /* GSAP target */
}
.progress-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--sp2);
}
.progress-label {
  font-size: var(--t-sm); font-weight: 700; color: var(--ink);
}
.progress-count {
  font-size: var(--t-xs); color: var(--slate);
}
.progress-track {
  height: 4px; background: var(--border);
  border-radius: var(--r-full); overflow: hidden;
  margin-bottom: var(--sp3);
}
.progress-fill {
  height: 100%; background: var(--grad); border-radius: var(--r-full);
  width: 20%; transition: width .5s var(--ease-expo);
}

.step-dots {
  display: flex; gap: var(--sp2);
}
.step-dot {
  flex: 1; height: 44px; /* full tap target height */
  display: flex; align-items: center;
  background: none; border: none; cursor: pointer;
  padding: 0; position: relative;
}
.step-dot::after {
  content: ''; position: absolute;
  left: 0; right: 0; height: 5px; border-radius: var(--r-full);
  background: var(--border);
  transition: background .3s, height .3s;
}
.step-dot.active::after  { background: var(--grad); height: 6px; }
.step-dot.done::after    { background: var(--blue); }
.step-dot:focus-visible  { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

/* ── Form card ──────────────────────────────────────────────────── */
.form-card {
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  overflow: hidden;
  opacity: 0; transform: translateY(22px); /* GSAP target */
}

/* ── Step panels ────────────────────────────────────────────────── */
.step-panel {
  display: none;
  padding: var(--sp6) var(--sp5) var(--sp5);
}
.step-panel.active { display: block; }

.step-header { margin-bottom: var(--sp5); }

.step-num {
  display: inline-block;
  font-size: var(--t-xs); font-weight: 700;
  letter-spacing: .1em; color: var(--blue);
  background: rgba(3,131,230,.09);
  padding: .2em .65em; border-radius: var(--r-sm);
  margin-bottom: var(--sp2);
}
.step-title {
  font-size: var(--t-2xl); font-weight: 700;
  letter-spacing: -0.02em; margin-bottom: var(--sp1);
}
.step-desc { font-size: var(--t-sm); color: var(--slate); }

/* ── Fields ─────────────────────────────────────────────────────── */
.fields { display: flex; flex-direction: column; gap: var(--sp5); }

.field-group { position: relative; }
.field-group.hidden { display: none; }

.field-label {
  display: block; font-size: var(--t-sm); font-weight: 600;
  color: var(--ink); margin-bottom: var(--sp2);
}
.opt-tag {
  font-weight: 400; color: var(--slate-lt); font-size: var(--t-xs);
}
.req-star { color: var(--blue); margin-left: 2px; }

.field-hint {
  font-size: var(--t-xs); color: var(--slate);
  line-height: 1.55; margin-bottom: var(--sp2);
}

.field-wrap { position: relative; }

.field-input {
  width: 100%; min-height: 52px;
  padding: 0 var(--sp4);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: inherit; font-size: var(--t-base);
  color: var(--ink); background: var(--bg);
  transition: border-color .22s, box-shadow .22s, background .22s;
  -webkit-appearance: none; appearance: none; outline: none;
}
.field-input:focus {
  border-color: var(--cyan); background: white;
  box-shadow: var(--sh-focus);
}
.field-input::placeholder { color: var(--slate-lt); }

textarea.field-input {
  min-height: 148px; padding: var(--sp3) var(--sp4);
  resize: vertical; line-height: 1.6;
}
select.field-input { padding-right: 2.5rem; cursor: pointer; }

/* Select arrow */
.select-wrap { position: relative; }
.select-wrap::after {
  content: '';
  position: absolute; right: 15px; top: 50%;
  transform: translateY(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--slate);
  pointer-events: none;
  transition: border-top-color .2s;
}
.select-wrap:focus-within::after { border-top-color: var(--blue); }

/* Validation states */
.field-group.err .field-input  { border-color: var(--error); box-shadow: 0 0 0 3px rgba(216,52,76,.14); }
.field-group.ok  .field-input  { border-color: var(--success); }

.field-error {
  font-size: var(--t-xs); color: var(--error); font-weight: 500;
  margin-top: var(--sp2);
  display: flex; align-items: center; gap: var(--sp1);
  min-height: 1.2em;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .2s, transform .2s;
}
.field-error.show { opacity: 1; transform: translateY(0); }

.field-ok-icon {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%) scale(0);
  color: var(--success); font-size: 1rem;
  pointer-events: none;
  transition: transform .22s cubic-bezier(0.34,1.56,0.64,1);
}
.field-group.ok .field-ok-icon { transform: translateY(-50%) scale(1); }

/* Shake on error */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  15%      { transform: translateX(-6px); }
  30%      { transform: translateX(6px); }
  45%      { transform: translateX(-4px); }
  60%      { transform: translateX(4px); }
  75%      { transform: translateX(-2px); }
}
.field-group.shaking .field-input { animation: shake .38s ease; }

/* ── Review items (step 5) ──────────────────────────────────────── */
.review-list { display: flex; flex-direction: column; gap: var(--sp3); }

.review-item {
  padding: var(--sp4); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: var(--sp1);
}
.review-lbl {
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--slate);
}
.review-val {
  font-size: var(--t-sm); color: var(--ink); font-weight: 500;
  word-break: break-word; line-height: 1.5;
}
.review-val.none { color: var(--slate-lt); font-style: italic; font-weight: 400; }

/* ── Error banner (submit fail) ─────────────────────────────────── */
.err-banner {
  margin-top: var(--sp4); padding: var(--sp4);
  background: var(--error-bg);
  border: 1px solid rgba(216,52,76,.25);
  border-radius: var(--r-md);
  font-size: var(--t-sm); color: var(--error); font-weight: 500;
  display: flex; gap: var(--sp3); align-items: flex-start;
}
.err-banner[hidden] { display: none; }

/* ── Desktop nav row (inside form card, hidden on mobile) ───────── */
.desk-nav {
  display: flex;
  justify-content: space-between; align-items: center;
  padding: var(--sp4) var(--sp5) var(--sp5);
  border-top: 1px solid var(--border);
  margin-top: var(--sp4);
  gap: var(--sp3);
}
/* Step 5 submit layout */
.desk-nav.col {
  flex-direction: column; align-items: stretch;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp2);
  font-family: inherit; font-weight: 700;
  border-radius: var(--r-md); cursor: pointer;
  min-height: 52px; padding: 0 var(--sp6);
  font-size: var(--t-base);
  transition: transform .1s, box-shadow .2s, opacity .2s;
  position: relative; overflow: hidden;
  border: none;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: var(--grad); color: white;
  box-shadow: var(--sh-btn);
}
.btn-primary:hover:not(:disabled) { box-shadow: var(--sh-btn-h); }

.btn-secondary {
  background: transparent; color: var(--slate);
  border: 1.5px solid var(--border);
  font-weight: 600;
}
.btn-secondary:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }

.btn-ghost {
  background: transparent; color: var(--blue);
  font-weight: 600; padding: var(--sp2) var(--sp3);
  min-height: 44px;
}
.btn-ghost:hover { background: rgba(3,131,230,.08); }

/* Spinner inside button */
.btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: white; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mobile sticky CTA bar ──────────────────────────────────────── */
.mobile-cta {
  display: none !important;
}
.mobile-cta.show { transform: translateY(0); }

.cta-info { display: flex; flex-direction: column; gap: 1px; }
.cta-step-tag { font-size: var(--t-xs); color: var(--slate); }
.cta-step-name { font-size: var(--t-sm); font-weight: 700; color: var(--ink); }

.cta-btns { display: flex; align-items: center; gap: var(--sp2); }

.btn-back {
  background: none; border: none;
  font-family: inherit; font-size: var(--t-sm); font-weight: 600;
  color: var(--slate); cursor: pointer;
  padding: var(--sp2) var(--sp3);
  border-radius: var(--r-md);
  min-height: 44px; min-width: 44px;
  transition: color .15s, background .15s;
}
.btn-back:hover { color: var(--ink); background: rgba(11,20,48,.06); }
.btn-back:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn-back[hidden] { display: none; }

/* ── Success card ───────────────────────────────────────────────── */
.success-card {
  background: var(--card); border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  padding: var(--sp10) var(--sp6);
  text-align: center; position: relative; overflow: hidden;
}
.success-card[hidden] { display: none; }

#confetti-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.success-icon-ring {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--success-bg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--sp6);
}
.checkmark-svg { width: 44px; height: 44px; }
.ck-path {
  stroke: var(--success); stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 62; stroke-dashoffset: 62;
  transition: stroke-dashoffset .65s var(--ease-expo) .3s;
}
.ck-path.drawn { stroke-dashoffset: 0; }

.success-title {
  font-size: var(--t-3xl); font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: var(--sp3);
}
.success-body {
  font-size: var(--t-base); color: var(--slate);
  line-height: 1.65; margin-bottom: var(--sp8);
}
.success-again { font-size: var(--t-sm); color: var(--slate); margin-top: var(--sp4); }
.success-again a { color: var(--blue); font-weight: 600; text-decoration: none; }
.success-again a:hover { text-decoration: underline; }

/* ── Admin password modal ───────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(11,20,48,.62);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp5);
  opacity: 0; transition: opacity .25s;
}
.modal-bg.show { opacity: 1; }
.modal-bg[hidden] { display: none; }

.modal-box {
  background: var(--card); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  padding: var(--sp8) var(--sp6);
  width: 100%; max-width: 380px;
  transform: translateY(18px) scale(.96);
  transition: transform .3s var(--ease-expo);
}
.modal-bg.show .modal-box { transform: translateY(0) scale(1); }

.modal-title { font-size: var(--t-xl); font-weight: 700; margin-bottom: var(--sp2); }
.modal-desc  { font-size: var(--t-sm); color: var(--slate); margin-bottom: var(--sp5); }
.modal-actions { display: flex; gap: var(--sp3); margin-top: var(--sp5); }
.modal-err { font-size: var(--t-xs); color: var(--error); font-weight: 500; margin-top: var(--sp2); min-height: 1.1em; }

/* ── Admin panel ────────────────────────────────────────────────── */
.admin-panel {
  position: fixed; inset: 0; z-index: 150;
  background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .42s var(--ease-expo);
}
.admin-panel.show  { transform: translateX(0); }
.admin-panel[hidden] { display: none; }

.admin-hdr {
  display: flex; align-items: center; gap: var(--sp3);
  padding: var(--sp4) var(--sp5);
  background: var(--card); border-bottom: 1px solid var(--border);
  flex-shrink: 0; flex-wrap: wrap;
}
.admin-hdr-title { font-size: var(--t-lg); font-weight: 700; flex: 1; }
.admin-actions { display: flex; gap: var(--sp2); flex-wrap: wrap; }

.admin-body { flex: 1; overflow-y: auto; padding: var(--sp5); }

.admin-empty {
  text-align: center; padding: var(--sp16) var(--sp5);
  color: var(--slate);
}
.admin-empty-ico { font-size: 3rem; opacity: .35; margin-bottom: var(--sp4); }
.admin-note {
  font-size: var(--t-xs); color: var(--slate-lt);
  margin-bottom: var(--sp5); line-height: 1.55;
}

/* ── Role sections ─────────────────────────────────────────────── */
.role-section { margin-bottom: var(--sp7); }
.role-section-hdr {
  display: flex; align-items: center; gap: var(--sp3);
  margin-bottom: var(--sp4); padding-bottom: var(--sp3);
  border-bottom: 1px solid var(--border);
}
.role-section-badge {
  display: inline-flex; align-items: center;
  font-size: var(--t-sm); font-weight: 700;
  padding: .3em 1em; border-radius: var(--r-full);
}
.role-section-badge.dev { background: rgba(0,185,254,.12); color: #0069b4; }
.role-section-badge.des { background: rgba(130,0,220,.1);  color: #6300c9; }
.role-section-badge.oth { background: rgba(91,101,119,.1); color: var(--slate); }
.role-section-count { font-size: var(--t-xs); color: var(--slate-lt); }

/* ── Apps grid — 3 columns ─────────────────────────────────────── */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp4);
}
@media (max-width: 1100px) { .apps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .apps-grid { grid-template-columns: 1fr; } }

.app-card {
  background: var(--card); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); border: 1px solid var(--border);
  padding: var(--sp4);
  transition: box-shadow .2s, opacity .3s, transform .3s;
  display: flex; flex-direction: column; gap: var(--sp3);
}
.app-card:hover { box-shadow: var(--sh-md); border-color: rgba(0,185,254,.3); }
.app-card.deleting { opacity: 0; transform: scale(.95) translateX(16px); }

.app-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp2);
}
.app-name { font-size: var(--t-base); font-weight: 700; line-height: 1.2; }
.card-date { font-size: var(--t-xs); color: var(--slate-lt); white-space: nowrap; flex-shrink: 0; }

.role-badge {
  display: inline-flex; align-items: center;
  font-size: var(--t-xs); font-weight: 700;
  padding: .25em .8em; border-radius: var(--r-full);
  flex-shrink: 0; white-space: nowrap;
}
.role-badge.dev  { background: rgba(0,185,254,.12); color: #0069b4; }
.role-badge.des  { background: rgba(130,0,220,.1); color: #6300c9; }
.role-badge.oth  { background: rgba(91,101,119,.1); color: var(--slate); }

.app-details { display: flex; flex-direction: column; gap: 6px; }
.app-row {
  display: flex; align-items: flex-start; gap: var(--sp2);
  font-size: var(--t-sm); color: var(--slate);
}
.app-row a { color: var(--blue); font-weight: 500; text-decoration: none; word-break: break-all; }
.app-row a:hover { text-decoration: underline; }

/* ── Chips (stack, type, has-file indicators) ──────────────────── */
.card-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 20px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--slate); white-space: nowrap;
}
.chip-file { background: rgba(0,185,254,.08); border-color: rgba(0,185,254,.3); color: #0069b4; }

.app-card-foot {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; margin-top: auto; padding-top: var(--sp3);
  border-top: 1px solid var(--border);
}

.btn-download-md {
  background: none; border: 1px solid var(--border);
  color: var(--slate-lt); font-family: inherit;
  font-size: var(--t-xs); font-weight: 600;
  cursor: pointer; padding: 4px 10px;
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
}
.btn-download-md:hover { background: var(--bg); color: var(--ink); }

.btn-delete {
  background: none; border: none;
  color: var(--error); font-family: inherit;
  font-size: var(--t-sm); font-weight: 600;
  cursor: pointer; padding: 4px 10px;
  border-radius: var(--r-sm);
  transition: background .15s;
}
.btn-delete:hover { background: rgba(216,52,76,.08); }

/* ── Detail modal ──────────────────────────────────────────────── */
.detail-modal-bg {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s;
  padding: var(--sp4);
}
.detail-modal-bg.show { opacity: 1; }
.detail-modal-bg[hidden] { display: none; }

.detail-modal-box {
  background: var(--card); border-radius: var(--r-lg);
  border: 1px solid var(--border); box-shadow: 0 24px 64px rgba(0,0,0,.5);
  width: min(95vw, 720px); max-height: 88vh;
  display: flex; flex-direction: column;
  transform: translateY(16px); transition: transform .25s;
}
.detail-modal-bg.show .detail-modal-box { transform: translateY(0); }

.detail-modal-hdr {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp3); padding: var(--sp5) var(--sp5) var(--sp4);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.detail-hdr-left { display: flex; align-items: center; gap: var(--sp3); flex-wrap: wrap; }
.detail-name { font-size: var(--t-xl); font-weight: 700; }
.detail-hdr-actions { display: flex; align-items: center; gap: var(--sp2); flex-shrink: 0; }

.btn-ghost {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--slate);
  padding: 6px 10px; border-radius: var(--r-sm);
  transition: background .15s, color .15s;
}
.btn-ghost:hover { background: var(--bg); color: var(--ink); }

.detail-body {
  flex: 1; overflow-y: auto; padding: var(--sp5);
  display: flex; flex-direction: column; gap: var(--sp4);
}

.detail-meta {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px 24px; padding: var(--sp4);
  background: var(--bg); border-radius: var(--r-md);
  border: 1px solid var(--border);
}
@media (max-width: 500px) { .detail-meta { grid-template-columns: 1fr; } }

.detail-row { display: flex; flex-direction: column; gap: 2px; }
.detail-lbl { font-size: var(--t-xs); font-weight: 700; color: var(--slate-lt); text-transform: uppercase; letter-spacing: .06em; }
.detail-row > span, .detail-row > a { font-size: var(--t-sm); color: var(--ink); word-break: break-word; }
.detail-row > a { color: var(--blue); text-decoration: none; }
.detail-row > a:hover { text-decoration: underline; }

.detail-section-title {
  font-size: var(--t-sm); font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--slate-lt);
  padding-bottom: var(--sp2); border-bottom: 1px solid var(--border);
}

.detail-qa { display: flex; flex-direction: column; gap: 8px; }
.detail-q {
  font-size: var(--t-xs); font-weight: 700; color: var(--slate);
  line-height: 1.4;
}
.detail-a {
  font-size: var(--t-sm); color: var(--ink); line-height: 1.7;
  white-space: pre-wrap; background: var(--bg);
  padding: var(--sp3) var(--sp4); border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.detail-why {
  font-size: var(--t-sm); color: var(--ink); line-height: 1.8;
  font-style: italic; white-space: pre-wrap;
  padding: var(--sp4); border-radius: var(--r-md);
  background: var(--bg); border-left: 3px solid var(--cyan);
}

/* ── Utility ────────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.live-region {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0);
}

/* ── Tablet ≥ 768px ─────────────────────────────────────────────── */
@media (min-width: 768px) {
  .app { padding-bottom: 0; }
  .mobile-cta { display: none !important; }
  .desk-nav { display: flex; }

  .site-header { position: sticky; top: 0; padding: var(--sp4) var(--sp8); }
  .header-logo-img { height: 81px; }
  .hero { padding: var(--sp12) var(--sp8) var(--sp8); }
  .form-container { padding: 0 var(--sp8) var(--sp12); max-width: 680px; }
  .step-panel { padding: var(--sp8) var(--sp8) var(--sp4); }
}

/* ── Desktop ≥ 1280px ───────────────────────────────────────────── */
@media (min-width: 1280px) {
  .app {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    max-width: 1440px; margin: 0 auto;
  }
  .site-header { grid-column: 1 / -1; }

  .hero {
    grid-column: 1; grid-row: 2;
    position: sticky; top: 73px;
    height: calc(100dvh - 73px);
    display: flex; align-items: center;
    padding: var(--sp16) var(--sp12);
    max-width: none;
  }

  .form-container {
    grid-column: 2; grid-row: 2;
    padding: var(--sp8) var(--sp12) var(--sp12);
    max-width: none; margin: 0;
  }
}

/* ── OR divider ─────────────────────────────────────────────────── */
.field-or-divider {
  display: flex; align-items: center; justify-content: center;
  gap: var(--sp3); margin: var(--sp3) 0;
}
.divider-line {
  flex: 1; height: 1px; background: var(--border);
}
.divider-text {
  font-size: var(--t-xs); font-weight: 700; color: var(--slate-lt);
  letter-spacing: .08em;
}

/* ── File dropzone ──────────────────────────────────────────────── */
.file-dropzone {
  border: 2px dashed var(--border);
  background: var(--bg);
  border-radius: var(--r-md);
  padding: var(--sp6) var(--sp4);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
  position: relative;
}
.file-dropzone:hover, .file-dropzone.dragover {
  border-color: var(--blue);
  background: rgba(3,131,230,.03);
}
.file-dropzone:focus-within {
  border-color: var(--cyan);
  box-shadow: var(--sh-focus);
}

.upload-icon {
  width: 32px; height: 32px; color: var(--slate);
  margin-bottom: var(--sp2);
}
.dropzone-text {
  font-size: var(--t-sm); color: var(--slate);
}
.dropzone-text .text-link {
  color: var(--blue); font-weight: 600; text-decoration: underline;
}

/* Dropzone active state */
.dropzone-active {
  display: flex; align-items: center; justify-content: space-between;
  text-align: left;
}
.dropzone-active[hidden] { display: none !important; }
.dropzone-idle[hidden] { display: none !important; }

.file-info-wrap {
  display: flex; align-items: center; gap: var(--sp3);
}
.file-icon {
  width: 28px; height: 28px; color: var(--blue);
}
.file-meta {
  display: flex; flex-direction: column; gap: 2px;
}
.file-name {
  font-size: var(--t-sm); font-weight: 600; color: var(--ink);
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-size {
  font-size: var(--t-xs); color: var(--slate-lt);
}

.btn-remove-file {
  background: none; border: none; color: var(--slate);
  cursor: pointer; padding: var(--sp2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.btn-remove-file:hover {
  background: rgba(216,52,76,.1); color: var(--error);
}
