/* StudySmarter brand tokens — mirrors careerkit/frontend/src/app/globals.css */
:root {
  --sm-blue: #1300FF;
  --sm-lime: #C6FA02;
  --sm-hotrod: #FF5C41;

  --background: #FCFCFD;
  --foreground: #232323;
  --card: #FFFFFF;
  --muted: #F6F4F1;
  --muted-foreground: #7B7B7B;
  --border: #E7E4E0;
  --input: #D8D4CF;

  --primary: var(--sm-blue);
  --primary-foreground: #FFFFFF;
  --accent: var(--sm-lime);
  --accent-foreground: #232323;
  --destructive: var(--sm-hotrod);

  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter Tight', sans-serif;

  --r-sm: 0.5rem;
  --r-md: 0.75rem;
  --r-lg: 1rem;
  --r-xl: 1.25rem;
  --r-2xl: 1.5rem;

  --shadow-xs: 0 1px 2px rgba(35,35,35,.05);
  --shadow-sm: 0 1px 3px rgba(35,35,35,.10), 0 1px 2px -1px rgba(35,35,35,.10);
  --shadow-md: 0 4px 8px -2px rgba(35,35,35,.10), 0 2px 4px -2px rgba(35,35,35,.06);
  --shadow-lg: 0 12px 16px -4px rgba(35,35,35,.08), 0 4px 6px -2px rgba(35,35,35,.03);
  --shadow-primary: 0 8px 24px -8px rgba(19,0,255,.40), 0 2px 6px -1px rgba(19,0,255,.20);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--muted);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  font-weight: 400;
  line-height: 1.5;
}

.page { min-height: 100vh; padding: 0; }
.container { max-width: 560px; margin: 0 auto; background: var(--background); min-height: 100vh; }

/* Header — StudySmarter logo + (optional) co-brand with customer */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
  min-height: 56px;
}
.brand-logo { display: inline-flex; align-items: center; line-height: 0; text-decoration: none; }
.brand-logo img { display: block; height: 24px; width: auto; }
.brand-x {
  font-family: var(--font-heading); font-weight: 600;
  font-size: 16px; color: var(--input);
  line-height: 1; letter-spacing: 0;
}
.brand-customer { display: inline-flex; align-items: center; }
.brand-customer-img {
  display: block; height: 22px; width: auto; max-width: 110px;
  object-fit: contain;
  border-radius: 4px;
  background: #FFFFFF;
}
.brand-customer-text {
  font-family: var(--font-heading); font-weight: 700;
  font-size: 14px; color: var(--foreground);
  letter-spacing: -0.02em;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-wordmark {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  color: var(--sm-blue);
  letter-spacing: -0.045em;
  text-decoration: none;
  line-height: 1;
}
.brand-wordmark:hover { color: var(--sm-blue); text-decoration: none; }

/* Success banner */
.success { padding: 28px 20px 24px; background: var(--background); }
.success-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.success-ring {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--sm-lime);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 20px -4px rgba(198,250,2,.45);
}
.success-ring svg { color: var(--foreground); }
.success-headline {
  font-family: var(--font-heading); font-weight: 800;
  font-size: 22px; line-height: 1.18; letter-spacing: -0.03em;
  color: var(--foreground);
  margin-bottom: 4px;
}
.success-sub { font-size: 14px; color: var(--muted-foreground); font-weight: 500; line-height: 1.4; }

.applied-card {
  display: flex; gap: 12px; align-items: center;
  padding: 14px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.applied-logo {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--sm-blue);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 18px;
  color: #FFFFFF; flex-shrink: 0; letter-spacing: -0.04em;
}
.applied-logo-img {
  object-fit: contain; background: #FFFFFF;
  border: 1px solid var(--border); padding: 6px;
}
.applied-meta { flex: 1; min-width: 0; }
.applied-title {
  font-family: var(--font-heading); font-weight: 700;
  font-size: 14px; line-height: 1.3; color: var(--foreground);
  letter-spacing: -0.01em; margin-bottom: 2px;
  /* allow up to 2 lines, then ellipsize */
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; overflow: hidden;
}
.applied-co { font-size: 13px; color: var(--muted-foreground); font-weight: 500; }
.applied-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px;
  background: var(--sm-lime);
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  color: var(--foreground);
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.applied-badge svg { width: 11px; height: 11px; }

/* Section header */
.section { padding: 28px 20px 10px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  background: var(--foreground);
  color: var(--sm-lime);
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.eyebrow svg { width: 11px; height: 11px; color: var(--sm-lime); }

.section-headline {
  font-family: var(--font-heading); font-weight: 800;
  font-size: 26px; line-height: 1.12; letter-spacing: -0.035em;
  color: var(--foreground);
  margin-bottom: 10px;
}
.section-headline em { font-style: normal; color: var(--sm-blue); }

.section-sub {
  font-size: 15px; color: var(--muted-foreground); font-weight: 500;
  line-height: 1.5;
  max-width: 480px;
}
.section-sub strong { color: var(--foreground); font-weight: 600; }

/* Job cards */
.jobs-list { padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 10px; }

.job-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px;
  transition: all 0.18s cubic-bezier(.4,0,.2,1);
  -webkit-tap-highlight-color: transparent;
  /* stagger fade-in (--i set inline per card) */
  animation: card-in 0.42s cubic-bezier(.4,0,.2,1) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (hover: hover) {
  .job-card:hover {
    border-color: var(--sm-blue);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 0 0 1px var(--sm-blue);
  }
}
.job-card.applied { background: var(--muted); border-color: var(--border); opacity: 0.72; }
@media (hover: hover) {
  .job-card.applied:hover { transform: none; border-color: var(--border); box-shadow: none; }
}

.job-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.job-logo {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 19px;
  color: #FFFFFF; flex-shrink: 0; letter-spacing: -0.04em;
}
.job-logo-img {
  object-fit: contain; background: #FFFFFF;
  border: 1px solid var(--border); padding: 6px;
  color: transparent; /* hide alt-text overflow if loading slowly */
}
.job-logo.bg-1 { background: linear-gradient(135deg, #1300FF, #5848FF); }
.job-logo.bg-2 { background: linear-gradient(135deg, #232323, #4F4F4F); }
.job-logo.bg-3 { background: linear-gradient(135deg, #FF5C41, #FF8366); }
.job-logo.bg-4 { background: var(--sm-lime); color: var(--foreground); }
.job-logo.bg-5 { background: linear-gradient(135deg, #1300FF, #00B8D9); }
.job-logo.bg-6 { background: var(--foreground); }
.job-logo.bg-7 { background: linear-gradient(135deg, #FF5C41, #FFB42E); }

.job-info { flex: 1; min-width: 0; }
.job-company {
  font-size: 12px; color: var(--muted-foreground); font-weight: 600;
  letter-spacing: -0.005em;
  margin-bottom: 2px;
}
.job-title {
  font-family: var(--font-heading); font-weight: 700;
  font-size: 16px; line-height: 1.3; color: var(--foreground);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.job-meta {
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  font-size: 13px; color: var(--muted-foreground); font-weight: 500;
}
.job-meta .salary { color: var(--foreground); font-weight: 600; }
.job-meta .dot { color: var(--input); }

.match-pill {
  position: absolute; top: 14px; right: 14px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px;
  background: rgba(19,0,255,0.06);
  border: 1px solid rgba(19,0,255,0.20);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 11px; font-weight: 700;
  color: var(--sm-blue);
  letter-spacing: -0.01em;
}
.match-pill::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--sm-blue);
}
/* keep the title clear of the absolute pill */
.job-info { padding-right: 86px; }

.job-foot {
  display: flex; align-items: center; gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  row-gap: 10px;
}
.foot-trust {
  flex: 1 1 200px;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted-foreground); font-weight: 500;
  min-width: 0;
}
.foot-spacer { flex: 1; }
.foot-trust svg { color: var(--sm-blue); flex-shrink: 0; }

.btn-cta {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 22px;
  min-height: 44px;
  background: var(--sm-blue);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(.4,0,.2,1);
  flex-shrink: 0;
  box-shadow: var(--shadow-primary);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-cta:hover {
  background: #0E00DB;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -8px rgba(19,0,255,.50);
}
.btn-cta:active { transform: scale(0.96); box-shadow: var(--shadow-sm); }
.btn-cta:disabled { cursor: wait; }
.btn-cta svg { width: 14px; height: 14px; color: var(--sm-lime); }

.btn-cta.applied-state {
  background: var(--muted);
  color: var(--muted-foreground);
  box-shadow: none;
  cursor: default;
}
.btn-cta.applied-state:hover { transform: none; background: var(--muted); box-shadow: none; }
.btn-cta.applied-state svg { color: var(--foreground); }

.btn-cta.btn-error { background: var(--destructive); box-shadow: 0 8px 24px -8px rgba(255,92,65,.4); }
.btn-cta.btn-error:hover { background: #E64A2E; }
.btn-cta.btn-error svg { color: #FFFFFF; }

/* Footer */
.footer-section {
  padding: 24px 20px 32px;
  border-top: 1px solid var(--border);
  background: var(--background);
  text-align: center;
}
.footer-text { font-size: 13px; color: var(--muted-foreground); margin-bottom: 8px; }
.footer-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 700; color: var(--sm-blue);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.footer-link:hover { text-decoration: underline; }

/* Sticky progress bar */
.progress-bar {
  position: sticky; bottom: 0; z-index: 40;
  background: var(--background);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  backdrop-filter: blur(8px);
}
.progress-label {
  font-family: var(--font-heading);
  font-size: 13px; font-weight: 700; color: var(--foreground);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.progress-label strong { color: var(--sm-blue); }
.progress-track {
  flex: 1;
  height: 6px;
  background: var(--muted);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  background: var(--sm-blue);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(.4,0,.2,1);
  width: 11%;
}

@keyframes pop { 0%{transform:scale(0)} 60%{transform:scale(1.18)} 100%{transform:scale(1)} }
.success-ring svg { animation: pop 0.55s cubic-bezier(.4,0,.2,1) 0.15s both; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .section-headline { font-size: 22px; }
  .success-headline { font-size: 20px; }
  .brand-customer-img { height: 18px; max-width: 84px; }
  .brand-customer-text { font-size: 12px; max-width: 130px; }
  .brand-logo img { height: 20px; }
  /* free up vertical space — header doesn't need to be sticky on phones */
  .app-header { position: static; min-height: 48px; padding: 10px 16px; }
  /* tighter card padding + smaller match-pill on phones */
  .job-card { padding: 16px; }
  .job-info { padding-right: 76px; }
  .match-pill { top: 12px; right: 12px; font-size: 10px; padding: 3px 8px; }
  .mega-cta { padding: 12px 14px; gap: 12px; min-height: 56px; }
  .mega-cta-line { font-size: 14px; }
  .mega-cta-sub { font-size: 11px; }
}

/* Lottie success celebration — small, in-card, anchored to the empty
   space below the match-pill so it reads as "this card was applied to". */
.lottie-celebration {
  pointer-events: none;
  z-index: 3;
  opacity: 1;
  transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}
.lottie-celebration.in-card {
  position: absolute;
  top: 44px;   /* sits just below the match-pill */
  right: 10px;
  width: 78px;
  height: 78px;
  display: flex; align-items: center; justify-content: center;
  animation: lottie-pop 0.35s cubic-bezier(.34,1.56,.64,1) both;
}
.lottie-celebration.in-card > svg,
.lottie-celebration.in-card > * {
  width: 100%; height: 100%;
}
.lottie-celebration.is-fading { opacity: 0; transform: scale(0.85); }

@keyframes lottie-pop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── Mega-apply CTA ──────────────────────────────────────────────────── */
.mega-cta-wrap {
  padding: 4px 20px 16px;
}
.mega-cta {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 14px 18px;
  min-height: 60px;
  background: var(--sm-blue);
  color: #FFFFFF;
  border: none;
  border-radius: var(--r-xl);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-primary);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: var(--font-heading);
  position: relative; overflow: hidden;
}
.mega-cta::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(198,250,2,0.18) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.6s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.mega-cta:hover::before { transform: translateX(100%); }
.mega-cta:hover { background: #0E00DB; transform: translateY(-1px); box-shadow: 0 16px 36px -10px rgba(19,0,255,.55); }
.mega-cta:active { transform: scale(0.985); }
.mega-cta:disabled { cursor: wait; opacity: 0.95; }
.mega-cta-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--sm-lime);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mega-cta-icon svg { width: 18px; height: 18px; color: var(--foreground); }
.mega-cta-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mega-cta-line { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.mega-cta-line strong { font-weight: 800; color: var(--sm-lime); }
.mega-cta-sub { font-size: 12px; font-weight: 500; opacity: 0.82; letter-spacing: -0.005em; }
.mega-cta.is-running .mega-cta-icon { animation: pulse-ring 0.9s ease-in-out infinite; }
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198,250,2,0.6); }
  50%      { box-shadow: 0 0 0 10px rgba(198,250,2,0); }
}
.mega-cta.is-done { background: var(--foreground); }
.mega-cta.is-done:hover { background: var(--foreground); transform: none; }
.mega-cta.is-done .mega-cta-icon { background: var(--sm-lime); animation: none; }

/* ─── Why-match (expandable disclosure) ───────────────────────────────
   Designed to look unambiguously like "tap for details" — solid pill,
   prominent border, lime-accented chevron in a circle so the affordance
   reads as a button, not informational text. */
.why-match-block { margin-top: 10px; max-width: 100%; }
.why-match {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 6px 6px 11px;
  min-height: 30px;
  background: var(--background);
  border: 1.5px solid var(--sm-blue);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 12.5px; font-weight: 700;
  color: var(--sm-blue);
  letter-spacing: -0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
  max-width: 100%;
}
.why-match:hover {
  background: var(--sm-blue);
  color: #FFFFFF;
}
.why-match:hover .why-chevron-wrap { background: var(--sm-lime); }
.why-match:hover .why-chevron { color: var(--foreground); }
.why-match:active { transform: scale(0.97); }
.why-match.is-open {
  background: var(--sm-blue);
  color: #FFFFFF;
}
.why-match.is-open .why-chevron-wrap { background: var(--sm-lime); }
.why-match.is-open .why-chevron { color: var(--foreground); }
.why-match .why-icon { width: 13px; height: 13px; flex-shrink: 0; }
.why-match .why-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.why-match .why-chevron-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(19,0,255,0.10);
  flex-shrink: 0;
  margin-left: 2px;
  transition: background 0.15s ease;
}
.why-match .why-chevron {
  width: 11px; height: 11px;
  color: var(--sm-blue);
  transition: transform 0.22s cubic-bezier(.4,0,.2,1), color 0.15s ease;
}
.why-match.is-open .why-chevron { transform: rotate(180deg); }

/* Summary line shown at the top of the expanded panel — the at-a-glance
   bits ("3 km · +€8k") that used to live in the pill itself */
.why-match-summary {
  font-size: 12.5px; font-weight: 600;
  color: var(--sm-blue);
  letter-spacing: -0.005em;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 2px;
}

/* Collapsible detail panel — uses max-height for cross-browser smoothness */
.why-match-detail {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.32s cubic-bezier(.4,0,.2,1), opacity 0.2s ease-out, margin-top 0.22s ease-out;
}
.why-match-detail.is-open {
  max-height: 420px;
  opacity: 1;
  margin-top: 10px;
}
.why-match-detail-inner {
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px 13px 11px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.why-detail-row {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 12.5px; line-height: 1.4;
  color: var(--foreground);
}
.why-detail-icon {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--background);
  border: 1px solid var(--border);
  color: var(--sm-blue);
  display: inline-flex; align-items: center; justify-content: center;
}
.why-detail-icon svg { width: 13px; height: 13px; }
.why-detail-text { flex: 1; min-width: 0; }
.why-detail-text strong {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  color: var(--foreground);
  margin-bottom: 1px;
  letter-spacing: -0.01em;
}
.why-detail-text span {
  display: block;
  color: var(--muted-foreground);
  font-weight: 500;
  letter-spacing: -0.003em;
}

/* Outbound link to the canonical job posting — sits in .job-foot
   in the slot the trust line used to occupy. Subtle so it doesn't
   compete with the Bewerben CTA. */
.job-url-link {
  flex: 1 1 auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 4px 6px 0;
  min-height: 32px;
  font-size: 12.5px; font-weight: 600;
  color: var(--muted-foreground);
  text-decoration: none;
  letter-spacing: -0.005em;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}
.job-url-link svg { width: 13px; height: 13px; flex-shrink: 0; }
.job-url-link:hover {
  color: var(--sm-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.job-url-link:active { color: var(--sm-blue); }

/* ─── Salary delta chip ──────────────────────────────────────────────── */
.salary-delta {
  display: inline-flex; align-items: center;
  padding: 1px 7px;
  background: var(--sm-lime);
  color: var(--foreground);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 11px; font-weight: 800;
  letter-spacing: -0.01em;
  margin-left: 4px;
}

/* ─── Reduced-motion: kill transforms + animations ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .lottie-celebration { display: none !important; }
}
