:root {
  color-scheme: dark;
  --bg: #07110f;
  --bg-soft: #0d1b18;
  --card: rgba(12, 30, 26, .76);
  --card-solid: #0d201c;
  --line: rgba(218, 187, 92, .18);
  --text: #f6f2e8;
  --muted: #a9b7ae;
  --gold: #dabb5c;
  --gold-2: #f1d985;
  --emerald: #15c992;
  --danger: #ff6b81;
  --ok: #4ee2a8;
  --shadow: 0 24px 70px rgba(0, 0, 0, .36);
  --radius: 28px;
}

:root.light {
  color-scheme: light;
  --bg: #f7f4e9;
  --bg-soft: #ffffff;
  --card: rgba(255, 255, 255, .75);
  --card-solid: #ffffff;
  --line: rgba(9, 86, 67, .13);
  --text: #11211e;
  --muted: #60716b;
  --gold: #a9791e;
  --gold-2: #d29d32;
  --emerald: #0a9673;
  --danger: #c4314c;
  --ok: #07865f;
  --shadow: 0 22px 55px rgba(19, 42, 37, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(218,187,92,.16), transparent 26rem),
    radial-gradient(circle at 84% 6%, rgba(21,201,146,.18), transparent 30rem),
    linear-gradient(135deg, var(--bg) 0%, #05100e 60%, var(--bg-soft) 100%);
  color: var(--text);
  overflow-x: hidden;
}

:root.light body {
  background:
    radial-gradient(circle at 12% 12%, rgba(210,157,50,.18), transparent 28rem),
    radial-gradient(circle at 84% 6%, rgba(10,150,115,.14), transparent 32rem),
    linear-gradient(135deg, #fbf8ef 0%, #eff7f2 100%);
}

.aurora {
  position: fixed;
  width: 42vw;
  height: 42vw;
  border-radius: 999px;
  filter: blur(82px);
  opacity: .45;
  pointer-events: none;
  z-index: -1;
}
.aurora-one { left: -14vw; top: 12vh; background: rgba(21, 201, 146, .32); }
.aurora-two { right: -12vw; bottom: -8vh; background: rgba(218, 187, 92, .25); }

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0 50px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 44px; }
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--emerald), #0c5c47 54%, var(--gold));
  color: #fff7da; font-weight: 900; letter-spacing: -1px;
  box-shadow: 0 18px 40px rgba(13, 122, 91, .26);
}
.brand strong { display: block; font-size: 1.04rem; }
.brand small { display: block; color: var(--muted); margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle, .ghost-link {
  border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--text);
  border-radius: 999px; padding: 10px 14px; text-decoration: none; font-weight: 700; cursor: pointer;
  backdrop-filter: blur(12px);
}
.theme-toggle { width: 44px; height: 44px; padding: 0; font-size: 1.1rem; }

.login-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; align-items: stretch; }
.hero-card, .auth-card, .converter-card, .job-card, .note-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}
.hero-card { padding: clamp(28px, 5vw, 62px); min-height: 500px; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { display: inline-flex; width: fit-content; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--gold-2); font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .11em; }
h1 { font-size: clamp(2.3rem, 5vw, 5.1rem); line-height: .92; letter-spacing: -.07em; margin: 18px 0 20px; }
p { color: var(--muted); line-height: 1.68; margin: 0; }
.feature-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.feature-row span, .badge, .status-pill { border: 1px solid var(--line); border-radius: 999px; padding: 10px 13px; color: var(--text); background: rgba(255,255,255,.04); font-weight: 700; font-size: .9rem; }
.auth-card { padding: 32px; align-self: center; }
.auth-card h2, .converter-card h2, .job-card h2 { margin: 0 0 8px; letter-spacing: -.04em; font-size: 1.45rem; }
.lock-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; background: rgba(218,187,92,.13); color: var(--gold-2); font-size: 1.5rem; margin-bottom: 22px; }
code { color: var(--gold-2); }
label { display: block; margin: 18px 0 8px; color: var(--text); font-size: .86rem; font-weight: 800; }
input, select {
  width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text);
  border-radius: 16px; padding: 15px 16px; outline: none; font: inherit; font-weight: 650;
}
input:focus, select:focus { border-color: rgba(218,187,92,.55); box-shadow: 0 0 0 4px rgba(218,187,92,.11); }
select option { color: #101816; }
.primary-btn, .url-row button, .download-btn {
  border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; justify-content: center; align-items: center;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #11211e; font-weight: 900; border-radius: 16px; padding: 15px 18px;
  box-shadow: 0 16px 34px rgba(218,187,92,.22);
  transition: transform .2s ease, filter .2s ease;
}
.primary-btn:hover, .url-row button:hover, .download-btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.primary-btn.large { width: 100%; margin-top: 18px; padding: 17px 20px; }
.primary-btn:disabled, .url-row button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.alert { padding: 13px 15px; border-radius: 14px; margin: 14px 0; background: rgba(21,201,146,.12); border: 1px solid rgba(21,201,146,.2); color: var(--text); }
.alert.error { background: rgba(255,107,129,.12); border-color: rgba(255,107,129,.25); color: #ffdce3; }
:root.light .alert.error { color: #8a1630; }
.hidden { display: none !important; }

.hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; margin-bottom: 24px; }
.hero h1 { max-width: 890px; font-size: clamp(2.2rem, 4.7vw, 4.5rem); }
.hero p { max-width: 760px; }
.status-pill { align-self: start; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(78,226,168,.65); animation: pulse 1.7s infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 14px rgba(78,226,168,0); } }
.app-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr); gap: 24px; align-items: start; }
.converter-card, .job-card, .note-card { padding: 26px; }
.section-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.url-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.preview {
  display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: center;
  border: 1px solid var(--line); border-radius: 22px; padding: 12px; margin: 16px 0 4px;
  background: rgba(255,255,255,.05);
}
.preview img { width: 130px; aspect-ratio: 16/9; object-fit: cover; border-radius: 16px; background: rgba(255,255,255,.07); }
.preview strong { display: block; margin-bottom: 5px; }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 8px; }
.tab { border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--muted); padding: 14px; border-radius: 16px; font: inherit; font-weight: 900; cursor: pointer; }
.tab.active { color: #11211e; background: linear-gradient(135deg, var(--emerald), #6ce0b9); border-color: transparent; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkline { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: start; color: var(--muted); font-weight: 650; line-height: 1.55; }
.checkline input { width: 18px; margin-top: 3px; }
.empty-state { text-align: center; padding: 52px 14px; }
.empty-state span { font-size: 3rem; color: var(--gold-2); }
.empty-state h3 { margin: 12px 0 8px; }
.job-title { font-weight: 900; letter-spacing: -.03em; font-size: 1.1rem; margin-bottom: 6px; overflow-wrap: anywhere; }
.job-sub { color: var(--muted); font-size: .92rem; margin-bottom: 18px; }
.progress-wrap { height: 13px; background: rgba(255,255,255,.08); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, var(--emerald), var(--gold-2)); transition: width .35s ease; }
.progress-info { display: flex; justify-content: space-between; color: var(--muted); margin-top: 10px; font-size: .9rem; font-weight: 800; }
.last-line { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 120px; overflow: auto; padding: 14px; border-radius: 16px; background: rgba(0,0,0,.18); color: var(--muted); border: 1px solid var(--line); margin: 18px 0; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.download-btn { width: 100%; }
.note-card { margin-top: 24px; color: var(--muted); line-height: 1.6; }
.note-card strong { color: var(--text); }

@media (max-width: 900px) {
  .login-grid, .app-grid, .hero { grid-template-columns: 1fr; }
  .hero-card { min-height: auto; }
  .status-pill { width: fit-content; }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 22px, 1180px); padding-top: 16px; }
  .topbar { margin-bottom: 28px; }
  .brand small { display: none; }
  .url-row, .options-grid, .preview { grid-template-columns: 1fr; }
  .preview img { width: 100%; }
  .hero h1, h1 { letter-spacing: -.055em; }
  .converter-card, .job-card, .note-card, .auth-card { padding: 20px; border-radius: 22px; }
}
