:root {
  --ink: #07142b;
  --ink-soft: #465268;
  --cream: #f5f2e9;
  --paper: #fffef9;
  --line: #d9ddd8;
  --lime: #dafa2e;
  --teal: #0aa99a;
  --teal-soft: #e3f5f1;
  --danger: #b83945;
  --shadow: 0 24px 70px rgba(7, 20, 43, 0.1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--cream); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body {
  min-width: 320px; min-height: 100vh; margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(218, 250, 46, 0.28), transparent 30rem),
    radial-gradient(circle at 92% 38%, rgba(10, 169, 154, 0.13), transparent 30rem),
    var(--cream);
}
button, input, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.65; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(10, 169, 154, 0.42); outline-offset: 3px; }

.app-shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  min-height: 76px; padding: 12px clamp(20px, 4vw, 64px); border-bottom: 1px solid rgba(7, 20, 43, 0.1);
  background: rgba(245, 242, 233, 0.9); backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 13px; color: var(--ink); font-size: 15px; font-weight: 780; text-decoration: none; }
.brand-logo { display: block; width: auto; height: 34px; flex: 0 0 auto; }
.brand-divider { width: 1px; height: 26px; background: rgba(7, 20, 43, 0.18); }
.session-tools { display: flex; align-items: center; gap: 14px; }
.ready-status { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.ready-status i, .ai-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(10, 169, 154, 0.13); }
.session-tools button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.55); font-size: 11px; font-weight: 800; }

main { width: min(1050px, calc(100% - 40px)); margin: 0 auto; padding: 78px 0 100px; }
.access-gate { display: grid; min-height: calc(100vh - 76px); place-items: center; padding-block: 48px; }
.access-card {
  width: min(620px, 100%); padding: clamp(30px, 6vw, 58px); border: 1px solid rgba(7,20,43,.11);
  border-radius: 28px; background: rgba(255,254,249,.97); box-shadow: var(--shadow); text-align: center;
}
.access-lock { display: grid; width: 62px; height: 62px; margin: 0 auto 22px; place-items: center; border-radius: 20px; background: var(--ink); color: var(--lime); font-size: 23px; }
.eyebrow { margin: 0 0 18px; color: var(--teal); font-size: 12px; font-weight: 880; letter-spacing: .15em; text-transform: uppercase; }
.access-card h1 { margin: 0; font-size: clamp(38px, 7vw, 58px); line-height: .98; letter-spacing: -.06em; }
.access-card > p:not(.eyebrow):not(.form-error) { max-width: 500px; margin: 22px auto 28px; color: var(--ink-soft); font-size: 16px; line-height: 1.55; }
.login-form { display: grid; max-width: 420px; margin: 0 auto; gap: 10px; text-align: left; }
.login-form label { margin-top: 4px; color: var(--ink-soft); font-size: 12px; font-weight: 830; }
.login-form input { width: 100%; min-height: 52px; padding: 0 15px; border: 1px solid #d4d9d3; border-radius: 13px; background: white; font-size: 16px; }
.login-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(10,169,154,.1); outline: none; }
.login-form button { display: flex; align-items: center; justify-content: space-between; min-height: 55px; margin-top: 8px; padding: 0 18px; border: 0; border-radius: 14px; background: var(--lime); color: var(--ink); font-weight: 900; }
.login-form button.secondary-button { justify-content: center; min-height: 44px; margin-top: 0; border: 1px solid var(--line); background: transparent; color: var(--ink-soft); font-size: 12px; }
.mfa-enrollment { margin-bottom: 7px; padding: 15px; border: 1px solid rgba(10,169,154,.2); border-radius: 15px; background: var(--teal-soft); text-align: center; }
.mfa-enrollment > p { margin: 0 0 12px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.mfa-enrollment img { display: block; width: min(220px, 100%); height: auto; margin: 0 auto 13px; border: 10px solid white; border-radius: 12px; }
.mfa-secret { display: grid; gap: 5px; margin-bottom: 0 !important; }
.mfa-secret span { font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.mfa-secret code { overflow-wrap: anywhere; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; user-select: all; }
.form-error { min-height: 22px; margin: 14px 0 0; color: var(--danger); font-size: 13px; font-weight: 700; }

.hero { margin: 0 auto 44px; text-align: center; }
.hero h1 { margin: 0; font-size: clamp(50px, 8vw, 92px); line-height: .92; letter-spacing: -.075em; }
.hero h1 span { position: relative; z-index: 0; }
.hero h1 span::after { position: absolute; right: -.035em; bottom: .015em; left: -.035em; z-index: -1; height: .21em; border-radius: 999px; background: var(--lime); content: ""; }
.hero-copy { max-width: 680px; margin: 28px auto 0; color: var(--ink-soft); font-size: clamp(16px, 2vw, 20px); line-height: 1.55; }
.prompt-card { padding: clamp(24px, 4vw, 42px); border: 1px solid rgba(7,20,43,.11); border-radius: 28px; background: rgba(255,254,249,.95); box-shadow: var(--shadow); }
.prompt-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.prompt-heading > div { display: flex; align-items: center; gap: 12px; }
.prompt-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.prompt-number { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 29px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 11px; font-weight: 900; }
.ai-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid rgba(10,169,154,.17); border-radius: 999px; background: var(--teal-soft); color: #087d73; font-size: 12px; font-weight: 760; }
textarea { display: block; width: 100%; min-height: 220px; padding: 24px; resize: vertical; border: 1px solid #d4d9d3; border-radius: 19px; background: #fff; font-size: clamp(17px, 2vw, 21px); font-weight: 620; line-height: 1.55; }
textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 5px rgba(10,169,154,.1); outline: none; }
.prompt-suggestions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 14px 0 25px; }
.prompt-suggestions > span { margin-right: 3px; color: #747d75; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.prompt-suggestions button { min-height: 34px; padding: 0 12px; border: 1px solid #d8ddd7; border-radius: 999px; background: #f6f8f4; color: var(--ink-soft); font-size: 11px; font-weight: 770; }
.prompt-suggestions button:hover { border-color: rgba(10,169,154,.55); background: var(--teal-soft); }
.target-duration { min-width: 0; margin: 0 0 22px; padding: 17px; border: 1px solid #d8ddd7; border-radius: 18px; background: #f8faf6; }
.target-duration legend { padding: 0 6px; color: var(--ink); font-size: 13px; font-weight: 850; }
.target-duration > p { margin: 0 0 13px; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.target-duration-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.target-duration-option { position: relative; min-width: 0; cursor: pointer; }
.target-duration-option input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.target-duration-choice {
  position: relative; display: flex; min-height: 64px; padding: 11px 12px; flex-direction: column; justify-content: center;
  border: 1px solid #d8ddd7; border-radius: 13px; background: white; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.target-duration-choice strong { font-size: 14px; line-height: 1.2; }
.target-duration-choice small { margin-top: 3px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.target-duration-option:hover .target-duration-choice { border-color: rgba(10,169,154,.58); transform: translateY(-1px); }
.target-duration-option input:checked + .target-duration-choice { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.target-duration-option input:focus-visible + .target-duration-choice { outline: 3px solid rgba(10,169,154,.42); outline-offset: 3px; }
.target-duration-recommended { position: absolute; top: 7px; right: 7px; color: #087d73; font-size: 7px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.target-duration[disabled] { opacity: .62; }
.target-duration[disabled] .target-duration-option { cursor: wait; }
.create-button { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; width: 100%; min-height: 82px; padding: 14px 20px; border: 0; border-radius: 18px; background: var(--ink); color: white; text-align: left; transition: transform .16s ease, box-shadow .16s ease; }
.create-button:hover { transform: translateY(-2px); box-shadow: 0 15px 35px rgba(7,20,43,.2); }
.create-icon { display: grid; width: 45px; height: 45px; place-items: center; border-radius: 14px; background: var(--lime); color: var(--ink); }
.create-button strong { display: block; font-size: 16px; }
.create-button small { display: block; margin-top: 5px; color: #bec8d7; font-size: 11px; }
.create-arrow { color: var(--lime); font-size: 26px; }
.plan-details { margin-top: 18px; border-top: 1px solid var(--line); }
.plan-details summary { display: flex; justify-content: space-between; padding: 18px 4px 8px; cursor: pointer; font-weight: 800; }
.plan-details summary small { color: var(--teal); }
.plan-details ol { margin: 10px 0 0; padding-left: 27px; color: var(--ink-soft); line-height: 1.8; }

.process-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0; padding: 21px 25px; border: 1px solid rgba(7,20,43,.09); border-radius: 20px; background: rgba(255,255,255,.5); }
.process-strip div { display: flex; align-items: center; gap: 10px; }
.process-strip strong { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--ink); color: var(--lime); font-size: 11px; }
.process-strip span { display: grid; gap: 3px; }
.process-strip b { font-size: 12px; }
.process-strip small { color: var(--ink-soft); font-size: 10px; }
.process-strip > i { color: #a6ada7; font-style: normal; }

.result-panel { display: grid; grid-template-columns: 1fr; gap: 20px; scroll-margin-top: 100px; }
.result-status, .video-result { padding: clamp(24px, 4vw, 38px); border: 1px solid rgba(7,20,43,.1); border-radius: 24px; background: rgba(255,254,249,.96); box-shadow: var(--shadow); }
.result-status-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.status-kicker { color: var(--teal); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.result-status h2 { margin: 8px 0 0; font-size: clamp(20px, 3vw, 29px); letter-spacing: -.04em; }
#status-percent { font-size: 30px; letter-spacing: -.05em; }
.progress-track { height: 10px; margin: 24px 0 20px; overflow: hidden; border-radius: 999px; background: #e5e8e2; }
.progress-track span { display: block; width: 3%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--lime)); transition: width .4s ease; }
.job-log { display: flex; flex-wrap: wrap; gap: 7px; }
.job-log span { padding: 7px 10px; border-radius: 999px; background: #f0f3ef; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.video-result { display: grid; grid-template-columns: minmax(190px, 260px) 1fr; align-items: center; gap: 28px; }
.reel-preview { padding: 9px; border-radius: 25px; background: var(--ink); box-shadow: 0 20px 45px rgba(7,20,43,.2); }
.reel-preview video { display: block; width: 100%; aspect-ratio: 9/16; border-radius: 17px; background: #111; object-fit: contain; }
.video-result-copy { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.video-result-copy span { display: block; margin-bottom: 8px; color: var(--teal); font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.video-result-copy strong { display: block; max-width: 330px; overflow-wrap: anywhere; font-size: 18px; }
.download-button { flex: 0 0 auto; padding: 14px 18px; border-radius: 999px; background: var(--lime); color: var(--ink); font-size: 12px; font-weight: 900; text-decoration: none; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: min(420px, calc(100vw - 44px)); padding: 14px 18px; border-radius: 14px; background: var(--ink); color: white; font-size: 13px; font-weight: 700; opacity: 0; transform: translateY(16px); pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: var(--danger); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 760px) {
  main { width: min(100% - 24px, 1050px); padding-top: 50px; }
  .topbar { min-height: 66px; padding-inline: 16px; }
  .brand-logo { height: 30px; }
  .brand-name, .ready-status span { display: none; }
  .brand-divider { display: none; }
  .hero h1 { font-size: clamp(46px, 15vw, 66px); }
  .prompt-heading { align-items: flex-start; }
  .ai-badge { display: none; }
  textarea { min-height: 190px; padding: 18px; }
  .target-duration-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process-strip { display: grid; grid-template-columns: 1fr 1fr; }
  .process-strip > i { display: none; }
  .video-result { grid-template-columns: 1fr; }
  .reel-preview { width: min(260px, 100%); margin: auto; }
  .video-result-copy { align-items: flex-start; flex-direction: column; }
}
