:root {
  --bg: #07111f;
  --bg2: #020711;
  --card: rgba(10, 18, 31, 0.84);
  --card2: rgba(14, 27, 47, 0.7);
  --line: rgba(148, 163, 184, 0.22);
  --line2: rgba(97, 218, 251, 0.35);
  --brand: #61dafb;
  --brand2: #0ea5e9;
  --txt: #f3f7ff;
  --muted: #a9b6cc;
  --good: #22c55e;
  --danger: #ef4444;
  --shadow: 0 24px 80px rgba(0,0,0,.45);
  --radius: 22px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 10px; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--txt);
  background: var(--bg2);
  overflow-x: hidden;
}

#tm-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(14,165,233,.22), transparent 32%),
    radial-gradient(circle at 78% 8%, rgba(97,218,251,.08), transparent 26%),
    linear-gradient(135deg, #07111f 0%, #0b1628 42%, #020711 100%);
  z-index: -1;
}

#tm-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .35;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
}

#tm-wrap { min-height: 100vh; padding: 10px 16px 34px; }
.container { width: 100%; max-width: none; }

img { display: block; max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
p { color: var(--muted); line-height: 1.6; }
h1 { color: var(--txt); font-size: clamp(1.65rem, 3vw, 2.25rem); line-height: 1.08; letter-spacing: -.03em; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 6px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 22px;
  width: 100%;
  min-height: 72px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(3, 8, 18, .78);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 54px rgba(0,0,0,.34);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--txt);
  font-weight: 900;
  font-size: 1.1rem;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand strong { color: var(--brand); }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #05111d;
  font-weight: 1000;
  font-size: 1.45rem;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 0 34px rgba(97,218,251,.2);
}

.topnav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}
.topnav button,
.logout-btn,
button {
  font-family: inherit;
  border: 0;
  cursor: pointer;
}
.topnav button,
.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--txt);
  background: transparent;
  font-weight: 800;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.topnav button:hover,
.logout-btn:hover {
  transform: translateY(-1px);
  border-color: var(--line);
  background: rgba(255,255,255,.055);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  color: var(--txt);
  font-size: .85rem;
}
.logout-btn { border-color: var(--line); background: rgba(255,255,255,.035); }
.badge, #accountType {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 1000;
  letter-spacing: .04em;
  color: #04111d;
  background: var(--brand);
  text-transform: uppercase;
}
.badge.free { color: var(--muted); background: rgba(148,163,184,.18); }
.badge.pro { color: #04111d; background: linear-gradient(135deg, var(--brand), var(--brand2)); }

.pg-tour-start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0 24px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  color: var(--brand);
  background: rgba(14, 165, 233, .12);
  font-weight: 900;
}

.dashboard-card,
.auth-section {
  width: min(100%, 900px);
  margin: 26px auto 0;
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(12,24,42,.82), rgba(5,10,18,.72));
  box-shadow: var(--shadow);
}
.auth-section { width: min(100%, 470px); margin-top: 90px; }
.auth-brand { text-align: center; margin-bottom: 24px; }
.logo { width: 72px; border-radius: 18px; margin: 0 auto 16px; }
.auth-brand p { margin-top: 8px; }

.hero-copy { margin-bottom: 28px; }
.hero-copy p { margin-top: 12px; font-size: 1.05rem; color: #d2d9e8; }

.form-group,
.input-group { display: flex; flex-direction: column; gap: 16px; }
.url-input-wrap { position: relative; }
.input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .8;
}
input[type="email"],
input[type="password"],
input[type="text"],
select,
textarea {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--txt);
  background: rgba(3, 9, 20, .62);
  outline: none;
  font: inherit;
  font-size: 1rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.url-input-wrap input { padding-left: 54px; }
input::placeholder { color: rgba(210,217,232,.72); }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(97,218,251,.11);
  background: rgba(3, 9, 20, .82);
}
select {
  display: block;
}
.password-container { position: relative; }
.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: .8;
}

.yt-preview {
  align-items: center;
  gap: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(13, 25, 44, .78);
}
.yt-preview img {
  width: 230px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}
.yt-preview strong { display: block; margin-bottom: 8px; font-size: 1.18rem; }
.yt-preview p { margin: 0; }

.url-info {
  padding: 14px 16px;
  border: 1px solid rgba(97,218,251,.25);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(97,218,251,.08);
}

.button-group { display: flex; gap: 12px; flex-wrap: wrap; }
.auth-actions { margin-top: 6px; }
.auth-actions button { flex: 1; min-height: 50px; }
.btn-primary,
.btn-ghost,
.btn-manage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 14px;
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.btn-primary {
  color: #04111d;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 14px 38px rgba(14,165,233,.22);
}
.btn-ghost,
.btn-manage {
  color: var(--txt);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
}
.btn-manage {
  color: var(--brand);
  border-color: var(--line2);
  padding-inline: 28px;
}
.btn-primary:hover,
.btn-ghost:hover,
.btn-manage:hover { transform: translateY(-1px); }
.single-action {
  padding-top: 14px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.status {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--txt);
  background: rgba(2, 7, 17, .75);
}
.status:not(:empty) { display: block; }
.status.success { border-color: rgba(34,197,94,.35); color: #dfffe9; }
.status.error { border-color: rgba(239,68,68,.35); color: #ffe1e1; }
.status.info { border-color: rgba(250,204,21,.45); background: rgba(250,204,21,.08); color: #fff6d9; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  min-width: min(440px, calc(100vw - 32px));
  margin: 0;
  box-shadow: 0 22px 70px rgba(0,0,0,.48);
}

.forgot-password {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: .92rem;
}
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; }
  .topnav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; padding-top: 4px; }
  .user-info { margin-left: auto; }
}

@media (max-width: 720px) {
  #tm-wrap { padding: 8px 10px 24px; }
  .topbar { gap: 12px; padding: 12px; }
  .brand { width: 100%; }
  .user-info { width: 100%; border-left: 0; padding-left: 0; flex-wrap: wrap; }
  .topnav button span { display: none; }
  .dashboard-card, .auth-section { margin-top: 34px; padding: 24px; }
  .pg-tour-start { margin-left: 4px; }
  .yt-preview { align-items: flex-start; flex-direction: column; }
  .yt-preview img { width: 100%; }
  .btn-manage { width: 100%; }
}

h1 {
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
}

.hero-copy h1 {
  font-size: clamp(1.45rem, 2.1vw, 1.8rem);
}

.topnav button {
  font-size: 1rem;
}

.topnav button span {
  font-size: 1rem;
}



/* Linguaskill Preparation entry point */
.linguaskill-card { margin-top: 22px; }
.linguaskill-card .eyebrow { display:block; font-size:.78rem; font-weight:700; letter-spacing:.08em; opacity:.8; margin-bottom:8px; }
.linguaskill-card h2 { margin:0 0 8px; }
.linguaskill-card p { max-width:760px; }
