/* Styles for the app screens: login, verify, start, reading CV */
:root {
  --primary-text: #0d0c0b;
  --orange: #fd611b;
  --white: #ffffff;
  --secondary-text: #343230;
  --subtle-text: #918c87;
  --tertiary-text: #5c5956;
  --muted-text: #77736f;
  --bg: #f4f6f8;
  --border: #dcdfe3;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body { font-family: "Readex Pro", system-ui, sans-serif; background: var(--bg); color: var(--primary-text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 3px; direction: ltr; }
.logo-mark { width: 36px; height: 39px; }
.logo-word { display: flex; align-items: flex-end; font-family: "Clash Display", sans-serif; font-weight: 600; font-size: 40px; line-height: 1; }
.logo-word img { width: 8px; height: 18px; margin-bottom: 3px; }
.logo.on-light .logo-word { color: var(--primary-text); }
.logo.on-dark .logo-word { color: var(--white); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 700; font-size: 16px; transition: background .2s, transform .2s, box-shadow .2s, border-color .2s, opacity .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.99); }
.btn-primary { background: var(--orange); color: var(--white); box-shadow: 0 8px 22px -10px rgba(253,97,27,.7); }
.btn-primary:hover { background: #e4510f; box-shadow: 0 12px 26px -10px rgba(253,97,27,.8); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline { background: transparent; border-color: var(--orange); color: var(--primary-text); font-weight: 400; }
.btn-outline:hover { background: rgba(253,97,27,.06); }
.btn-google { background: var(--white); color: var(--primary-text); height: 48px; box-shadow: 0 1px 2px rgba(13,12,11,.04); }
.btn-google:hover { box-shadow: 0 8px 20px -10px rgba(13,12,11,.25); }
.btn-google svg { width: 22px; height: 22px; }

/* ================= Auth split screen ================= */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-art { position: relative; background: var(--primary-text); overflow: hidden; display: grid; place-items: center; }
.auth-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 50% 50%, rgba(253,97,27,.12), transparent 70%); pointer-events: none; }
.auth-lottie { position: relative; width: min(90%, 600px); aspect-ratio: 640 / 680; }
.auth-lottie:empty { background: url("assets/hero-cv.png") center / contain no-repeat; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-box { width: 100%; max-width: 490px; }
.auth-box .logo { margin-bottom: 72px; }
.auth-title { font-size: 26px; font-weight: 700; line-height: 1.3; }
.auth-sub { margin-top: 8px; font-size: 17px; color: var(--muted-text); line-height: 1.5; }
.auth-sub bdi { color: var(--tertiary-text); }
.stack { display: flex; flex-direction: column; }
.auth-step { animation: stepIn .5s cubic-bezier(.2,.7,.2,1) both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.or { display: flex; align-items: center; gap: 16px; margin: 24px 0 22px; color: var(--muted-text); font-size: 15px; white-space: nowrap; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: #e2c9bd; }

.field label { display: block; font-weight: 700; font-size: 17px; margin-bottom: 8px; }
.input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); font: inherit; font-size: 17px; color: var(--primary-text); transition: border-color .2s, box-shadow .2s; }
.input::placeholder { color: #9a9590; }
.input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(253,97,27,.15); }
.input.is-invalid { border-color: #e5484d; box-shadow: 0 0 0 4px rgba(229,72,77,.12); }
.field-error { margin-top: 6px; font-size: 14px; color: #e5484d; min-height: 20px; }

.actions { margin-top: 32px; gap: 18px; }

/* OTP */
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 28px; direction: ltr; }
.otp input { width: 100%; height: 48px; text-align: center; border: 1px solid var(--border); border-radius: 8px; background: var(--white); font: inherit; font-size: 20px; color: var(--primary-text); transition: border-color .2s, box-shadow .2s, transform .2s; }
.otp input::placeholder { color: #a7a29d; font-size: 16px; }
.otp input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(253,97,27,.15); transform: translateY(-1px); }
.otp input.filled { border-color: var(--orange); }
.otp.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.resend { margin-top: 18px; font-size: 15px; color: var(--muted-text); }
.link-btn { background: none; border: 0; color: var(--orange); font-weight: 700; padding: 0; }
.link-btn:disabled { color: var(--muted-text); font-weight: 400; cursor: default; }
.verify-actions { margin-top: 150px; gap: 14px; }
.back-link { align-self: center; font-size: 15px; color: var(--muted-text); }
.back-link:hover { color: var(--primary-text); }

/* ================= App shell (after login) ================= */
.topbar { background: var(--primary-text); color: var(--white); }
.topbar .inner { max-width: 1456px; margin: 0 auto; padding: 0 24px; height: 102px; display: flex; align-items: center; justify-content: space-between; }
.user { display: flex; align-items: center; gap: 12px; font-size: 17px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--secondary-text); display: grid; place-items: center; }
.avatar svg { width: 20px; height: 20px; }
.app-main { min-height: calc(100vh - 102px); display: flex; align-items: center; justify-content: center; padding: 48px 24px 120px; }
.app-title { font-size: 26px; font-weight: 600; text-align: center; margin-bottom: 28px; }

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 480px)); gap: 20px; }
.choice { position: relative; text-align: start; background: var(--white); border: 1px solid transparent; border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 14px; transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s, border-color .3s; }
.choice:hover { transform: translateY(-4px); border-color: rgba(253,97,27,.35); box-shadow: 0 22px 46px -20px rgba(253,97,27,.45); }
.choice:focus-visible { outline: 3px solid rgba(253,97,27,.4); outline-offset: 2px; }
.choice-icon { width: 46px; height: 46px; border-radius: 10px; background: var(--orange); display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgba(253,97,27,.8); transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.choice:hover .choice-icon { transform: scale(1.08) rotate(-6deg); }
.choice-icon svg { width: 22px; height: 22px; }
.choice h2 { font-size: 20px; font-weight: 600; }
.choice p { font-size: 20px; line-height: 1.65; color: var(--tertiary-text); text-wrap: pretty; }

/* Reading CV */
.reading { width: 100%; max-width: 482px; background: var(--white); border-radius: 16px; padding: 24px; }
.file { display: flex; align-items: center; gap: 16px; }
.file-badge { width: 52px; height: 52px; border-radius: 10px; background: var(--orange); color: var(--white); font-weight: 700; font-size: 16px; display: grid; place-items: center; flex-shrink: 0; text-transform: uppercase; }
.file-name { font-weight: 600; font-size: 16px; word-break: break-all; }
.file-size { font-size: 14px; color: var(--muted-text); margin-top: 6px; }
.progress { height: 3px; background: #eef0f2; border-radius: 3px; margin: 24px 0 22px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--orange); border-radius: 3px; box-shadow: 0 0 10px rgba(253,97,27,.6); transition: width .6s ease; }
.checklist { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.checklist li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--secondary-text); opacity: .35; transition: opacity .4s; }
.checklist li.active, .checklist li.done { opacity: 1; }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #e4e6e9; display: grid; place-items: center; flex-shrink: 0; transition: background .3s, border-color .3s; }
.tick svg { width: 12px; height: 12px; opacity: 0; transform: scale(.4); transition: opacity .3s, transform .35s cubic-bezier(.3,1.6,.5,1); }
li.active .tick { border-color: var(--orange); border-top-color: transparent; animation: spin .8s linear infinite; }
li.done .tick { background: var(--orange); border-color: var(--orange); animation: none; box-shadow: 0 0 10px rgba(253,97,27,.5); }
li.done .tick svg { opacity: 1; transform: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.reading .btn { margin-top: 26px; }
.dots::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* Responsive */
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 300px; }
  .auth-lottie { width: min(60%, 260px); }
  .auth-box .logo { margin-bottom: 40px; }
  .verify-actions { margin-top: 48px; }
  .choices { grid-template-columns: 1fr; max-width: 480px; }
}
@media (max-width: 600px) {
  .auth-art { min-height: 220px; }
  .auth-lottie { width: 180px; }
  .auth-main { padding: 32px 16px; }
  .auth-title, .app-title { font-size: 22px; }
  .otp input { height: 44px; }
  .topbar .inner { height: 72px; padding: 0 16px; }
  .topbar .user span { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .logo-word { font-size: 30px; }
  .topbar .logo-mark { width: 28px; height: 30px; }
  .app-main { min-height: calc(100vh - 72px); padding: 32px 16px 64px; }
  .choice p { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.topbar .inner { gap: 16px; }
.user { min-width: 0; }
.user span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .topbar .user span:last-child { max-width: 150px; font-size: 14px; } .avatar { width: 34px; height: 34px; } }

/* Reading screen: fixed-size card that never resizes with its content */
#step-reading { width: 100%; }
.reading { width: 560px; max-width: 100%; min-height: 330px; padding: 28px; display: flex; flex-direction: column; }
.reading .btn { margin-top: auto; }
.reading .checklist { margin-bottom: 28px; }
.file > div { min-width: 0; flex: 1; }
.file-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }
.file-badge { font-size: 14px; }
.dots { display: inline-block; width: 1.2em; text-align: start; }
#step-reading .app-title { min-height: 1.4em; }
@media (max-width: 600px) { .reading { min-height: 0; padding: 22px; } .reading .btn { margin-top: 4px; } }
/* Email sign-in link sent (used until custom SMTP enables the 6-digit code) */
.link-sent { margin-top: 26px; background: var(--white); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.link-ico { width: 52px; height: 52px; border-radius: 14px; background: rgba(253,97,27,.1); color: var(--orange); display: grid; place-items: center; animation: linkPulse 2s ease-in-out infinite; }
.link-ico svg { width: 26px; height: 26px; }
@keyframes linkPulse { 50% { box-shadow: 0 0 0 8px rgba(253,97,27,.08); } }
.link-sent p { font-size: 16px; line-height: 1.6; color: var(--secondary-text); }
.link-sent .link-tip { font-size: 14px; color: var(--muted-text); }
.link-mode .otp, .link-mode #verify-btn { display: none; }
.link-mode .verify-actions { margin-top: 28px; }
.btn.is-busy { opacity: .75; cursor: progress; }
.auth-consent { font-size: 13px; color: var(--muted-text); text-align: center; line-height: 1.6; }
.auth-consent a { color: var(--secondary-text); text-decoration: underline; text-underline-offset: 2px; }
