/* Teaching Jobs VN website. Design: design-review/website/mockup.html (#83).
   Colours are the Mini App's tokens (miniapp/src/css/app.scss). */
:root {
  --green: #1f5a50;
  --green-pressed: #18483f;
  --green-2: #dfece6;
  --warm: #c75f3e;
  --warm-2: #f6e5db;
  --ink: #17211f;
  --ink-soft: #34433f;
  --muted: #5f6d68;
  --line: #e4e9e6;
  --paper: #ffffff;
  --surface: #f4f7f5;
  --tint: #f1f6f3;
  /* One radius rule: buttons are pills, containers 20px, inner bits 12px. */
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-phone: 0 2px 4px rgba(23,45,40,.08), 0 40px 70px -20px rgba(23,45,40,.35);
  --wrap: 1200px;
  --ease: cubic-bezier(.22,.8,.24,1);
}
* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.025em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 45%, transparent); outline-offset: 3px; border-radius: 8px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 30; padding: 10px 14px; background: #fff; border-radius: 8px; }
/* QR codes are drawn by script; without it they would be empty boxes. */
html:not(.js) .js-only { display: none !important; }
.ic { width: 1em; height: 1em; flex: none; }
[data-qr] svg { display: block; width: 100%; height: 100%; }

/* Buttons: one primary label everywhere ("Open in Zalo") */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 26px; border-radius: 999px; border: 0;
  font: 600 16px/1 "Be Vietnam Pro", sans-serif; text-decoration: none; white-space: nowrap; cursor: pointer;
  background: var(--green); color: #fff;
  box-shadow: 0 12px 24px -10px rgba(31,90,80,.6);
  transition: background .2s, transform .2s, box-shadow .2s;
}
.btn:hover { background: var(--green-pressed); transform: translateY(-1px); box-shadow: 0 16px 28px -10px rgba(31,90,80,.6); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn .ic { font-size: 20px; }
.btn-light { background: #fff; color: var(--green); box-shadow: none; }
.btn-light:hover { background: var(--green-2); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.88); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -0.015em; white-space: nowrap; }
/* The mark's own cream tile fades into a light page: a hairline and a soft
   shadow (same 17% corner radius as the tile) lift it off the background. */
.brand img { width: 42px; height: 42px; border-radius: 17%; box-shadow: 0 0 0 1px rgba(23,45,40,.08), 0 6px 14px -6px rgba(23,45,40,.28); }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink-soft); font-weight: 500; font-size: 15px; transition: color .2s; }
.nav a:hover { color: var(--green); }
.lang { display: flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.lang a { font: 600 13px/1 "Be Vietnam Pro", sans-serif; color: var(--muted); padding: 7px 11px; border-radius: 999px; text-decoration: none; }
.lang a[aria-current="page"] { background: var(--ink); color: #fff; }
.site-header .btn { min-height: 42px; padding: 0 18px; font-size: 15px; box-shadow: none; }
/* Pages without the section nav (legal pages) push the switch right. */
.site-header .brand + .lang { margin-left: auto; }

/* Hero: left copy, right real product */
.hero { position: relative; padding: 56px 0 24px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.hero h1 { margin-top: 24px; font-size: clamp(38px, 4.6vw, 60px); font-weight: 800; letter-spacing: -0.035em; }
.hero h1 span { color: var(--green); }
.hero .lead { margin-top: 22px; max-width: 30ch; font-size: 20px; line-height: 1.55; color: var(--ink-soft); }
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 36px; }
.qr { display: flex; align-items: center; gap: 14px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.qr [data-qr] { width: 76px; height: 76px; padding: 6px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); }
.qr strong { display: block; color: var(--ink); font-weight: 600; }

.hero-visual { position: relative; height: 720px; }
.phone { width: 300px; padding: 10px; border-radius: 48px; background: #121a18; box-shadow: var(--shadow-phone); }
.phone img { width: 100%; aspect-ratio: 1170 / 2532; object-fit: cover; object-position: top; border-radius: 39px; background: var(--paper); }
.hero-visual .phone { position: absolute; }
.hero-visual .phone.main { left: 0; top: 0; z-index: 2; }
.hero-visual .phone.behind { left: 190px; top: 90px; width: 270px; }

/* Sections */
section { scroll-margin-top: 84px; }
.section { padding: 112px 0; }
.head { max-width: 680px; }
.head h2 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 800; letter-spacing: -0.03em; }
.head p { margin-top: 16px; max-width: 56ch; color: var(--muted); font-size: 18px; }

/* How it works: steps on the left drive one real phone on the right */
.how .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.switch { display: inline-flex; gap: 4px; margin-top: 36px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.switch button { border: 0; background: none; padding: 11px 22px; border-radius: 999px; cursor: pointer; font: 600 15px/1 "Be Vietnam Pro", sans-serif; color: var(--muted); transition: background .2s, color .2s; }
.switch button[aria-selected="true"] { background: var(--ink); color: #fff; }
.steps { margin: 28px 0 0; padding: 0; list-style: none; }
.steps[hidden] { display: none; }
.steps button {
  position: relative;
  display: grid; grid-template-columns: 44px 1fr; gap: 4px 16px; width: 100%; padding: 22px 20px; margin: 0;
  border: 0; border-radius: var(--radius); background: none; text-align: left; cursor: pointer; font: inherit; color: inherit;
  transition: background .35s var(--ease), box-shadow .35s var(--ease);
}
.steps button:hover { background: var(--surface); }
.steps button[aria-current="true"] { background: #fff; outline: 1px solid var(--line); box-shadow: 0 1px 2px rgba(23,45,40,.05), 0 14px 30px -18px rgba(23,45,40,.3); }
.steps .n { grid-row: span 2; align-self: start; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--green-2); color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; transition: background .25s, color .25s; }
.steps button[aria-current="true"] .n { background: var(--green); color: #fff; }
.steps strong { align-self: center; min-height: 44px; display: flex; align-items: center; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.steps span.d { display: grid; grid-template-rows: 0fr; opacity: 0; color: var(--muted); font-size: 16px; transition: grid-template-rows .5s var(--ease), opacity .4s var(--ease); }
.steps span.d > span { overflow: hidden; min-height: 0; }
.steps button[aria-current="true"] span.d { grid-template-rows: 1fr; opacity: 1; }
/* Auto-play: the active step's bar fills, then the next step opens. Pauses
   on hover and off screen; a click hands control to the visitor. */
.steps .bar { position: absolute; left: 80px; right: 20px; bottom: 10px; height: 2px; border-radius: 2px; overflow: hidden; opacity: 0; transition: opacity .3s; }
.steps .bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: color-mix(in srgb, var(--green) 45%, transparent); transform: scaleX(0); transform-origin: left; }
.how.autoplay .steps button[aria-current="true"] .bar { opacity: 1; }
.how.autoplay .steps button[aria-current="true"] .bar i { animation: step-fill 5s linear forwards; animation-play-state: paused; }
.how.autoplay.in-view:not(:hover):not(:focus-within) .steps button[aria-current="true"] .bar i { animation-play-state: running; }
@keyframes step-fill { to { transform: scaleX(1); } }
.how-visual { display: grid; place-items: center; padding: 48px 0; border-radius: 32px; background: var(--tint); }
.how-visual .phone { width: 360px; border-radius: 56px; padding: 12px; }
.how-visual .screens { border-radius: 45px; }
.screens { position: relative; aspect-ratio: 1170 / 2532; overflow: hidden; border-radius: 39px; background: var(--paper); }
.screens img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; opacity: 0; transform: translateY(18px) scale(.985); transition: opacity .55s var(--ease), transform .8s var(--ease); }
.screens img.active { opacity: 1; transform: none; }
.screens img.leaving { opacity: 0; transform: translateY(-14px) scale(.985); }

/* Privacy: one statement, three plain columns, no cards */
.privacy { background: var(--tint); }
.privacy-points { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 56px; border-top: 1px solid #d9e5de; }
.privacy-points div { padding: 32px 32px 0 0; }
.privacy-points div + div { padding-left: 32px; border-left: 1px solid #d9e5de; }
.privacy-points .ic { font-size: 30px; color: var(--green); }
.privacy-points h3 { margin-top: 18px; font-size: 20px; font-weight: 700; }
.privacy-points p { margin-top: 8px; color: var(--muted); font-size: 16px; }
.privacy-points a { color: var(--green); font-weight: 600; }

/* Questions: answers visible, two columns */
.qa { display: grid; grid-template-columns: 1fr 1fr; gap: 44px 72px; margin-top: 56px; }
.qa h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.qa p { margin-top: 8px; color: var(--muted); font-size: 16px; }
.qa a { color: var(--green); font-weight: 600; }

/* Closing call to action */
.cta { padding: 0 0 112px; }
.cta-card { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; padding: 64px; border-radius: 32px; background: var(--green); color: #fff; }
/* The glow is positioned, so it would paint over (and swallow clicks on) the
   unpositioned copy and button: it lets clicks through and the copy sits above. */
.cta-card::before { content: ""; position: absolute; right: -140px; bottom: -220px; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.12), rgba(255,255,255,0)); pointer-events: none; }
.cta-card > div { position: relative; }
.cta-card h2 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 800; }
.cta-card p { margin-top: 14px; max-width: 40ch; color: #cfe0d9; font-size: 18px; }
.cta-card .btn { margin-top: 32px; }
.cta-qr { position: relative; padding: 16px 16px 12px; border-radius: var(--radius); background: #fff; color: var(--muted); text-align: center; font-size: 13px; font-weight: 600; }
.cta-qr [data-qr] { width: 156px; height: 156px; margin: 0 auto 8px; }

/* Reveal once on scroll: fade up, lightly staggered (site.js adds .shown). */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

/* Legal pages: one readable column */
.legal { max-width: 760px; margin: 0 auto; padding: 56px 24px 96px; }
.legal h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 800; letter-spacing: -0.03em; }
.legal .updated { margin: 12px 0 40px; color: var(--muted); font-size: 15px; }
.legal h2 { margin: 44px 0 12px; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.legal p, .legal li { color: var(--ink-soft); }
.legal p + p { margin-top: 14px; }
.legal ul { padding-left: 22px; }
.legal li + li { margin-top: 6px; }
.legal a { color: var(--green); font-weight: 600; }
.legal table { width: 100%; margin: 16px 0; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.legal th, .legal td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal th { background: var(--surface); font-weight: 600; }

/* /app: one card that opens the app */
.app-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; background: var(--tint); }
.app-card { width: 100%; max-width: 440px; padding: 40px 32px 32px; border-radius: 32px; background: #fff; box-shadow: 0 1px 2px rgba(23,45,40,.05), 0 30px 60px -30px rgba(23,45,40,.35); text-align: center; }
.app-card > img { width: 88px; height: 88px; margin: 0 auto; border-radius: 17%; box-shadow: 0 0 0 1px rgba(23,45,40,.08), 0 10px 22px -10px rgba(23,45,40,.35); }
.app-card h1 { margin-top: 22px; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.app-card .lead { margin-top: 10px; color: var(--ink-soft); }
.app-card .lead + .lead { margin-top: 4px; color: var(--muted); font-size: 15px; }
.app-card .btn { width: 100%; margin-top: 28px; }
.app-qr { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.app-qr [data-qr] { width: 180px; height: 180px; margin: 0 auto 12px; }
.app-card .fineprint { margin-top: 24px; font-size: 13px; color: var(--muted); }
.app-card .fineprint a { color: var(--green); font-weight: 600; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 44px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 24px; }
.site-footer nav a { text-decoration: none; color: var(--ink-soft); font-weight: 500; }
.site-footer nav a:hover { color: var(--green); }
.site-footer .trademark { flex-basis: 100%; font-size: 13px; color: var(--muted); }

/* Touch screens: thumb-sized targets (44px) for the language switch and tabs. */
@media (pointer: coarse) {
  .lang a { min-width: 44px; min-height: 40px; display: grid; place-items: center; }
  .switch button { min-height: 46px; }
}

/* Small laptops: the hero's column is narrower than the two phones at full
   size, so the back one would be cut off by the page edge. */
@media (min-width: 981px) and (max-width: 1180px) {
  .hero-visual { height: 620px; }
  .hero-visual .phone.main { width: 250px; border-radius: 42px; }
  .hero-visual .phone.behind { left: 150px; top: 80px; width: 225px; border-radius: 38px; }
  .hero-visual .phone img { border-radius: 32px; }
}

/* Tablet */
@media (max-width: 980px) {
  .nav { display: none; }
  .site-header .wrap { gap: 16px; }
  .lang { margin-left: auto; }
  .hero .wrap, .how .wrap { grid-template-columns: 1fr; }
  .hero-visual { height: 560px; max-width: 470px; width: 100%; margin: 8px auto 0; }
  .hero-visual .phone.main { width: 260px; }
  .hero-visual .phone.behind { left: auto; right: 0; width: 230px; }
  .how .wrap { gap: 40px; }
  .how-visual .phone { width: 320px; border-radius: 50px; padding: 11px; }
  .how-visual .screens { border-radius: 40px; }
  .privacy-points { grid-template-columns: 1fr; }
  .privacy-points div, .privacy-points div + div { padding: 28px 0; border-left: 0; border-bottom: 1px solid #d9e5de; }
  .qa { grid-template-columns: 1fr; gap: 32px; }
}
/* Phone */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .site-header .btn { display: none; }
  .hero { padding-top: 32px; }
  .hero .lead { font-size: 18px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .qr { display: none; } /* On a phone the button opens Zalo directly. */
  .hero-visual { height: 470px; }
  .hero-visual .phone.main { width: 215px; border-radius: 38px; padding: 8px; }
  .hero-visual .phone.behind { width: 190px; top: 70px; border-radius: 34px; padding: 7px; }
  .phone img, .screens { border-radius: 31px; }
  .section { padding: 80px 0; }
  .switch { display: flex; }
  .switch button { flex: 1; padding: 11px 8px; }
  .steps button { padding: 18px 14px; }
  .how-visual { padding: 32px 0; }
  .how-visual .phone { width: 250px; border-radius: 40px; padding: 8px; }
  .how-visual .screens { border-radius: 33px; }
  .cta-card { grid-template-columns: 1fr; padding: 40px 24px; }
  .cta-card .btn { width: 100%; }
  .cta-qr { display: none; }
  .legal { padding: 40px 18px 72px; }
  /* Three columns don't fit a phone: each row becomes a small block, with
     the data in bold, then where it comes from, then why. */
  .legal table, .legal tbody, .legal tr, .legal td { display: block; }
  .legal thead { display: none; }
  .legal tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .legal td { padding: 0; border: 0; }
  .legal td:first-child { color: var(--ink); font-weight: 600; }
  .legal td:nth-child(2) { margin-top: 2px; color: var(--muted); font-size: 14px; }
  .legal td:nth-child(3) { margin-top: 6px; }
  .app-qr { display: none; } /* On a phone the button is the way in. */
}
/* Narrow phones (320–380px) */
@media (max-width: 380px) {
  .site-header .wrap { gap: 10px; }
  .brand { gap: 8px; font-size: 16px; }
  .brand img { width: 36px; height: 36px; }
  .app-card { padding: 32px 20px 28px; }
  .app-card h1 { font-size: 26px; }
  /* Both languages don't fit on one line: stack them, without the dot. */
  .app-card .btn { flex-direction: column; gap: 2px; padding: 12px 18px; line-height: 1.35; }
  .app-card .btn .sep { display: none; }
}
