/* Corinia — foundations: tokens, type, controls. Shared by the site and the app. */

@font-face {
  font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/inter-latin-ext-opsz-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/inter-latin-opsz-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter Variable', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter Variable', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: #e4e4e7;
  --line-2: #d2d2d7;
  --paper: #ffffff;          /* page */
  --card: #ffffff;           /* raised surfaces */
  --field: #ffffff;          /* inputs */
  --mist: #f5f5f7;           /* quiet background */
  --mist-2: #fafafa;
  --mist-hover: #ececef;
  --track: #ececef;
  --ring: rgba(0, 0, 0, 0.045);
  --glass: rgba(255, 255, 255, 0.8);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --veil: rgba(245, 245, 247, 0.86);
  --flash: #1d1d1f;
  --stage: linear-gradient(180deg, #dff1e7 0%, #eef7f2 100%);

  --green: #0a7f4f;          /* Corinia green: fills */
  --green-d: #086a42;
  --green-text: #0a7f4f;     /* Corinia green: text and icons */
  --green-ink: #0a4d34;
  --green-deep: #052b1e;
  --green-bright: #4fd69c;
  --green-soft: #e5f4ec;
  --green-mist: #f1f8f4;
  --reach: #9a4a06;
  --reach-soft: #fdf1e3;
  --amber-ink: #6f3604;
  --match: #0a58a6;
  --match-soft: #e8f1fb;
  --safe: #2f5d54;
  --safe-soft: #e8f0ee;
  --red: #b3261e;
  --red-soft: #fcebea;
  --red-ink: #7d1a14;
  --focus: #0a7f4f;
  --select: #c9ecd9;

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --r-xl: 28px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-3: 0 4px 12px rgba(0, 0, 0, 0.05), 0 30px 80px rgba(0, 0, 0, 0.12);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
}

/* Dark mode: only when the person switched to it (data-theme on <html>). Light is the default. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --ink: #f2f4f3;
  --ink-2: #cfd4d1;
  --muted: #9aa19d;
  --faint: #7d8480;
  --line: #262b28;
  --line-2: #363c39;
  --paper: #0b0d0c;
  --card: #171a19;
  --field: #101312;
  --mist: #111413;
  --mist-2: #1d2120;
  --mist-hover: #242827;
  --track: #2a2f2c;
  --ring: rgba(255, 255, 255, 0.07);
  --glass: rgba(11, 13, 12, 0.78);
  --glass-strong: rgba(11, 13, 12, 0.92);
  --veil: rgba(11, 13, 12, 0.8);
  --flash: #2c312e;
  --stage: linear-gradient(180deg, #10271d 0%, #0d1713 100%);
  --green-d: #0c9159;
  --green-text: #4fd69c;
  --green-ink: #b9ecd3;
  --green-deep: #0e3b2a;
  --green-soft: rgba(79, 214, 156, 0.13);
  --green-mist: #0f1714;
  --reach: #f0a55c;
  --reach-soft: rgba(240, 165, 92, 0.15);
  --amber-ink: #f5c595;
  --match: #72b4f7;
  --match-soft: rgba(114, 180, 247, 0.15);
  --safe: #86cbb8;
  --safe-soft: rgba(134, 203, 184, 0.14);
  --red: #ff7b72;
  --red-soft: rgba(255, 123, 114, 0.14);
  --red-ink: #ffb4ae;
  --focus: #4fd69c;
  --select: rgba(79, 214, 156, 0.3);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 30px 80px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.47 var(--font); letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--select); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: calc(720px + 2 * var(--gutter)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ---- type ---- */
.display { font: 600 clamp(2.6rem, 7.2vw, 5.25rem) / 1.04 var(--font-display); letter-spacing: -0.035em; text-wrap: balance; }
.h1 { font: 600 clamp(2.2rem, 5.2vw, 3.5rem) / 1.07 var(--font-display); letter-spacing: -0.03em; text-wrap: balance; }
.h2 { font: 600 clamp(1.75rem, 3.6vw, 2.5rem) / 1.1 var(--font-display); letter-spacing: -0.026em; text-wrap: balance; }
.h3 { font: 600 1.3125rem / 1.2 var(--font-display); letter-spacing: -0.018em; }
.h4 { font: 600 1.0625rem / 1.3 var(--font); letter-spacing: -0.012em; }
.lead { font-size: clamp(1.125rem, 2vw, 1.3125rem); line-height: 1.42; color: var(--muted); letter-spacing: -0.014em; text-wrap: pretty; }
.eyebrow { font: 600 0.8125rem / 1.2 var(--font); letter-spacing: 0.01em; color: var(--muted); }
.small { font-size: 0.875rem; line-height: 1.45; letter-spacing: -0.006em; }
.tiny { font-size: 0.75rem; line-height: 1.4; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.link { color: var(--green-text); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.arrow-link { color: var(--green-text); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.arrow-link::after { content: '›'; font-size: 1.25em; line-height: 0.8; transform: translateY(-1px); transition: transform 0.2s var(--ease); }
.arrow-link:hover::after { transform: translate(3px, -1px); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px; border-radius: 980px; border: 1px solid transparent;
  font: 500 1.0625rem / 1 var(--font); letter-spacing: -0.012em; white-space: nowrap; cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.1s var(--ease), opacity 0.2s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-d); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #000; }
.btn-secondary { background: var(--mist); color: var(--ink); }
.btn-secondary:hover { background: var(--mist-hover); }
.btn-outline { border-color: var(--line-2); color: var(--ink); background: var(--card); }
.btn-outline:hover { border-color: var(--ink); }
.btn-danger { color: var(--red); background: var(--red-soft); }
.btn-ghost { color: var(--ink-2); padding-inline: 12px; }
.btn-ghost:hover { background: var(--mist); }
.btn-s { min-height: 34px; padding: 0 15px; font-size: 0.875rem; }
.btn-l { min-height: 52px; padding: 0 28px; font-size: 1.125rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: 0.5; pointer-events: none; }
/* On a phone a long label (Romanian ones often are) wraps inside its button, and buttons in a row wrap to the next line. */
@media (max-width: 560px) {
  .btn { white-space: normal; text-align: center; line-height: 1.2; padding-top: 9px; padding-bottom: 9px; max-width: 100%; }
  .row:has(> .btn) { flex-wrap: wrap; }
}
.btn .spinner { width: 16px; height: 16px; }

.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- forms ---- */
.field { display: block; }
.field + .field { margin-top: 18px; }
.label { display: block; font: 500 0.875rem / 1.3 var(--font); margin-bottom: 7px; color: var(--ink); letter-spacing: -0.006em; }
/* The small "i" and its bubble. */
.label-row { display: flex; align-items: center; gap: 2px; margin-bottom: 7px; }
.label-row .label { margin-bottom: 0; }
.tip { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--faint); cursor: pointer; vertical-align: middle; margin: -4px 0 -4px 2px; transition: color 0.15s, background 0.15s; -webkit-tap-highlight-color: transparent; }
.tip:hover, .tip[aria-expanded='true'] { color: var(--green-text); background: var(--green-soft); }
.tip .icon { width: 16px; height: 16px; pointer-events: none; }
.tip-body { position: fixed; z-index: 90; width: max-content; max-width: min(300px, calc(100vw - 24px)); padding: 12px 14px; border-radius: 14px; background: var(--card); box-shadow: 0 0 0 1px var(--ring), var(--shadow-2); font: 400 0.8125rem/1.45 var(--font); letter-spacing: -0.003em; text-transform: none; text-align: left; white-space: normal; color: var(--ink-2); animation: pop 0.16s var(--ease) both; }
.tip-body[hidden] { display: none; }
@media print { .tip { display: none; } }
.hint { display: block; font-size: 0.8125rem; line-height: 1.4; color: var(--muted); margin-top: 6px; letter-spacing: -0.003em; }
.input, .select, .textarea {
  display: block; width: 100%; min-height: 48px; padding: 11px 15px; background: var(--field);
  border: 1px solid var(--line-2); border-radius: 12px; outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
/* A button beside a field is as tall as the field. */
.row > .input ~ .btn, .row > .select ~ .btn, .row > .btn:has(~ .input) { min-height: 48px; }
input.input { height: 48px; }
.select { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: #b9b9be; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(10, 127, 79, 0.14); }
.input.is-error { border-color: var(--red); }
.error-text { color: var(--red); font-size: 0.875rem; margin-top: 8px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 0.9375rem; line-height: 1.45; }
.check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--green); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px 14px; }
.grid-2 > .field + .field, .grid-3 > .field + .field { margin-top: 0; }
/* A row of fields keeps the same distance from its neighbours as one field does. */
.field + .grid-2, .field + .grid-3, .grid-2 + .field, .grid-3 + .field, .grid-2 + .grid-2, .grid-2 + .grid-3, .grid-3 + .grid-2, .grid-3 + .grid-3 { margin-top: 18px; }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---- numbered steps (country guides, application guides, match pages) ---- */
.steps { counter-reset: step; max-width: 760px; }
.steps.is-center { margin-inline: auto; }
.steps li { counter-increment: step; position: relative; padding: 0 0 28px 52px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%; color: var(--green-text); background: var(--green-soft); display: grid; place-items: center; font: 600 0.8125rem/1 var(--font); }
.steps li:not(:last-child)::after { content: ''; position: absolute; left: 15.5px; top: 36px; bottom: 6px; width: 1px; background: var(--line); }
.steps h3 { font: 600 1.0625rem/1.35 var(--font); letter-spacing: -0.012em; }
.steps p { color: var(--muted); margin-top: 4px; }

/* ---- small parts ---- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 980px; font: 600 0.75rem / 1 var(--font); letter-spacing: 0; white-space: nowrap; background: var(--mist); color: var(--ink-2); }
.pill-reach { background: var(--reach-soft); color: var(--reach); }
.pill-match { background: var(--match-soft); color: var(--match); }
.pill-safe { background: var(--safe-soft); color: var(--safe); }
.pill-contender { background: #efe9fb; color: #5a3aa8; }
.pill-far { background: var(--mist); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
:root[data-theme='dark'] .pill-contender { background: rgba(167, 139, 250, 0.16); color: #c4b1fb; }
.pill-green { background: var(--green-soft); color: var(--green-text); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-line { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted); }

.checked { display: inline-flex; align-items: center; gap: 5px; color: var(--green-text); font: 500 0.8125rem / 1.2 var(--font); letter-spacing: -0.003em; }
.checked svg { width: 14px; height: 14px; flex: none; }
.unchecked { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font: 500 0.8125rem / 1.2 var(--font); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); }
.card-pad { padding: clamp(20px, 3vw, 28px); }
.divide > * + * { border-top: 1px solid var(--line); }

.notice { padding: 14px 16px; border-radius: var(--r-m); background: var(--mist); font-size: 0.9375rem; line-height: 1.45; }
.notice-green { background: var(--green-soft); color: var(--green-ink); }
.notice-red { background: var(--red-soft); color: var(--red-ink); }
.notice-amber { background: var(--reach-soft); color: var(--amber-ink); }

.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-s { width: 16px; height: 16px; }

.logo { display: inline-flex; align-items: center; gap: 9px; font: 600 1.1875rem / 1 var(--font-display); letter-spacing: -0.025em; color: var(--ink); }
.logo svg { width: 22px; height: 22px; }
.logo svg path { stroke: var(--green-text); }
.logo svg circle { fill: var(--green-text); }

.progress { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--green); border-radius: 3px; transition: width 0.5s var(--ease); }

/* ---- motion: short, and only where something changes ---- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.16s; animation-timing-function: ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.97); } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes tick { 0% { transform: scale(0.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.progress > i { transform-origin: left center; animation: grow 0.55s var(--ease) both; }
dialog[open] { animation: pop 0.18s var(--ease); }
dialog[open]::backdrop { animation: fade 0.18s ease; }
html.theming, html.theming *, html.theming *::before, html.theming *::after { transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, fill 0.25s ease, stroke 0.25s ease !important; }

/* The moment of arrival: the mark draws itself, then gets out of the way. Under a second. */
.intro { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--paper); pointer-events: none; animation: intro-out 0.28s ease 0.62s forwards; }
.intro svg { width: 64px; height: 64px; overflow: visible; }
.intro path { stroke: var(--green-text); stroke-dasharray: 46; stroke-dashoffset: 46; animation: intro-draw 0.42s var(--ease) 0.05s forwards; }
.intro circle { fill: var(--green-text); transform-origin: 19.4px 12px; transform: scale(0); animation: intro-dot 0.22s var(--ease) 0.4s forwards; }
@keyframes intro-draw { to { stroke-dashoffset: 0; } }
@keyframes intro-dot { 60% { transform: scale(1.25); } to { transform: scale(1); } }
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }

/* The light / dark button: a small sun that turns into a moon. */
.tbtn { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #e79d10; cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease; -webkit-tap-highlight-color: transparent; }
.tbtn svg { width: 19px; height: 19px; overflow: visible; transition: transform 0.2s var(--ease); }
.tbtn:hover { background: var(--mist-2); }
.lbtn { font: 600 0.6875rem/1 var(--font); letter-spacing: 0.06em; color: var(--ink-2); text-decoration: none; }
.lbtn:hover { color: var(--ink); }
.tbtn-sun circle, .tbtn-moon { fill: currentColor; }
.tbtn:active svg { transform: scale(0.86); }
.tbtn-sun, .tbtn-moon { transform-origin: 12px 12px; transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.2s ease; }
.tbtn-moon { opacity: 0; transform: rotate(-80deg) scale(0.4); }
.tbtn:hover .tbtn-sun { transform: rotate(45deg); }
:root[data-theme='dark'] .tbtn { color: #f4e3a1; }
:root[data-theme='dark'] .tbtn-sun { opacity: 0; transform: rotate(80deg) scale(0.4); }
:root[data-theme='dark'] .tbtn-moon { opacity: 1; transform: none; }
:root[data-theme='dark'] .tbtn:hover .tbtn-moon { transform: rotate(-14deg); }
/* While the page cross-fades between themes, the button keeps its own motion. */
html.theming .tbtn .tbtn-sun, html.theming .tbtn .tbtn-moon, html.theming .tbtn circle { transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.2s ease, stroke 0.25s ease, fill 0.25s ease !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .intro { display: none; }
}
