:root {
  --bg: #0a0e0c;
  --bg-soft: #111814;
  --ink: #f8fbf7;
  --muted: rgba(232, 240, 232, 0.72);
  --line: rgba(255, 255, 255, 0.12);
  --surface: rgba(14, 18, 16, 0.74);
  --surface-strong: rgba(18, 24, 20, 0.9);
  --surface-soft: rgba(255, 255, 255, 0.06);
  --accent: #c8ff28;
  --accent-strong: #8fdb12;
  --accent-ink: #0f1609;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --layout-edge: clamp(18px, 3.2vw, 56px);
  --hero-left-width: minmax(380px, 640px);
  --hero-right-width: minmax(320px, 360px);
  --side-panel-width: min(440px, calc(100vw - 1rem));
}

:root[data-theme="light"] {
  --bg: #edf2ec;
  --bg-soft: #dfe6dd;
  --ink: #152017;
  --muted: rgba(21, 32, 23, 0.72);
  --line: rgba(21, 32, 23, 0.12);
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(247, 249, 245, 0.94);
  --surface-soft: rgba(21, 32, 23, 0.05);
  --accent: #9ad400;
  --accent-strong: #70b300;
  --accent-ink: #0f1609;
  --shadow: 0 24px 80px rgba(31, 44, 35, 0.16);
}

:root[data-theme="graphite"] {
  --bg: #0b1015;
  --bg-soft: #111923;
  --ink: #f2f6fb;
  --muted: rgba(228, 235, 245, 0.72);
  --line: rgba(255, 255, 255, 0.1);
  --surface: rgba(18, 24, 32, 0.78);
  --surface-strong: rgba(20, 28, 36, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --accent: #63f0d2;
  --accent-strong: #3db7a2;
  --accent-ink: #071311;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 214, 155, 0.24), transparent 22rem),
    radial-gradient(circle at 14% 26%, color-mix(in srgb, var(--bg-soft) 78%, transparent), transparent 34rem),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-soft) 52%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--bg) 84%, transparent) 0%, color-mix(in srgb, var(--bg-soft) 68%, transparent) 36%, rgba(0, 0, 0, 0.12) 100%),
    radial-gradient(circle at 74% 24%, rgba(255, 201, 132, 0.2), transparent 22rem);
  pointer-events: none;
  z-index: -1;
}

.portal-auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.portal-shell,
.compact-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.compact-shell {
  width: min(760px, calc(100% - 2rem));
}

.panel,
.login-card,
.hero-card,
.side-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.panel {
  border-radius: 24px;
  padding: 1.5rem;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.login-wrapper {
  width: min(460px, 100%);
}

.login-card {
  border-radius: 28px;
  padding: 2rem;
}

.login-card-header {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.brand-icon {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--accent-ink);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  box-shadow: 0 18px 36px rgba(143, 219, 18, 0.22);
}

.login-title {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.02;
}

.login-subtitle,
.lead,
.hint,
.message,
label span,
dt,
.section-copy,
.help-copy,
.nav-user-copy span,
.feature-glass-card p {
  color: var(--muted);
}

.login-subtitle {
  margin: 0;
  max-width: 30ch;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.35rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.mode-button {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.mode-button-active {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.stack {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.45rem;
}

input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  font: inherit;
  color: var(--ink);
}

input:focus {
  outline: 2px solid rgba(200, 255, 40, 0.16);
  border-color: rgba(200, 255, 40, 0.56);
}

.remember-toggle {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.7rem;
}

.remember-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.primary-button,
.ghost-button,
.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1rem;
  border-radius: 14px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--accent-ink);
}

.ghost-button,
.nav-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
}

.nav-button-highlight {
  background: rgba(200, 255, 40, 0.14);
  border-color: rgba(200, 255, 40, 0.28);
}

.disabled-link {
  pointer-events: none;
  opacity: 0.55;
}

.hidden,
.hidden-form {
  display: none;
}

.login-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--accent);
}

h1,
h2,
h3,
strong,
dd {
  color: var(--ink);
}

h1,
h2 {
  margin: 0 0 0.75rem;
}

.dashboard-shell {
  min-height: 100vh;
}

.dashboard-shell.dashboard-view-settings .dashboard-hero {
  display: none;
}

.dashboard-shell.dashboard-view-settings .settings-screen {
  display: block;
}

.dashboard-shell.dashboard-view-subscription .dashboard-hero {
  display: none;
}

.dashboard-shell.dashboard-view-subscription .settings-screen {
  display: none;
}

.dashboard-shell.dashboard-view-subscription #subscriptionScreen {
  display: block;
}

.portal-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 10, 0.86);
  backdrop-filter: blur(24px);
}

.portal-nav-inner {
  width: 100%;
  min-height: 88px;
  margin: 0 auto;
  padding-inline: var(--layout-edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.nav-user-button {
  padding: 0.45rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 22px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.nav-user-button:hover,
.nav-user-button:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
  transform: translateY(-1px);
}

.nav-user-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.nav-user-copy strong,
.nav-user-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-badge,
.avatar-image {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  flex: 0 0 auto;
}

.avatar-badge {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--accent-ink);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.avatar-image {
  object-fit: cover;
  border: 1px solid var(--line);
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.dashboard-hero {
  position: relative;
  min-height: calc(100vh - 88px);
  display: grid;
  align-items: center;
  overflow: hidden;
}

.dashboard-hero-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 20%, rgba(255, 212, 150, 0.34), transparent 20rem),
    radial-gradient(circle at 28% 34%, rgba(14, 18, 22, 0.92), transparent 18rem),
    linear-gradient(120deg, rgba(3, 7, 6, 0.96) 4%, rgba(8, 11, 10, 0.6) 40%, rgba(17, 13, 11, 0.24) 100%);
}

.dashboard-hero-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 52%, rgba(0, 0, 0, 0.74), transparent 18rem),
    radial-gradient(circle at 72% 46%, rgba(28, 40, 49, 0.54), transparent 24rem),
    linear-gradient(90deg, rgba(2, 4, 4, 0.8) 0%, rgba(7, 10, 9, 0.42) 48%, rgba(16, 18, 17, 0.08) 100%);
}

.dashboard-hero-backdrop::after {
  content: "";
  position: absolute;
  left: 56%;
  top: 48%;
  width: 30rem;
  height: 30rem;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 70% 18%, rgba(255, 214, 168, 0.16), transparent 42%),
    radial-gradient(circle at 44% 52%, rgba(34, 54, 62, 0.52), transparent 62%),
    radial-gradient(circle at 46% 68%, rgba(8, 12, 18, 0.9), transparent 78%);
  filter: blur(14px);
  opacity: 0.9;
}

.dashboard-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 9, 8, 0.14) 0%, rgba(6, 9, 8, 0.22) 100%);
}

.dashboard-hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--hero-left-width) minmax(160px, 1fr) var(--hero-right-width);
  gap: clamp(1.5rem, 3vw, 4rem);
  align-items: center;
  padding-inline: var(--layout-edge);
}

.hero-copy {
  display: grid;
  gap: 1rem;
}

.hero-copy-centered {
  grid-column: 1;
  max-width: 560px;
  justify-self: start;
}

.overview-title {
  margin: 0;
  font-size: clamp(2.35rem, 5vw, 4.8rem);
  line-height: 0.96;
  max-width: 12ch;
  text-wrap: balance;
}

.overview-lead {
  margin: 0;
  max-width: 52ch;
  font-size: 1.02rem;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
  margin-top: 0.5rem;
}

.status-pill {
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(200, 255, 40, 0.24);
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
  font-weight: 700;
}

.hero-feature-stack {
  grid-column: 3;
  display: grid;
  gap: 1rem;
  width: min(100%, 360px);
  justify-self: end;
}

.settings-screen {
  position: relative;
  min-height: calc(100vh - 88px);
  padding: 2.25rem var(--layout-edge) 2rem;
}

.settings-screen-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.settings-screen-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.settings-screen-copy,
.settings-card-copy,
.field-note {
  max-width: 56ch;
}

.settings-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.settings-card {
  padding: 1.2rem;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.settings-card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.2rem;
}

.settings-card-copy {
  margin: 0 0 1rem;
}

.compact-form {
  margin-top: 0.45rem;
}

.theme-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.45rem;
}

.theme-choice {
  min-width: 120px;
  min-height: 46px;
  padding: 0 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.theme-choice:hover,
.theme-choice:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(200, 255, 40, 0.34);
}

.theme-choice-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--accent-ink);
  border-color: transparent;
}

.field-note {
  margin: 1rem 0 0;
  color: var(--muted);
}

.settings-screen-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 1.1rem;
}

.subscription-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.plan-card {
  padding: 1.4rem;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.plan-card-accent {
  background:
    linear-gradient(180deg, rgba(103, 93, 255, 0.34) 0%, rgba(28, 24, 42, 0.78) 100%);
  border-color: rgba(132, 126, 255, 0.36);
}

.plan-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.plan-card-header h3 {
  margin: 0;
  font-size: clamp(1.8rem, 2vw, 2.25rem);
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: rgba(132, 126, 255, 0.28);
  color: #e6e2ff;
  font-size: 0.78rem;
  font-weight: 700;
}

.plan-price {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 1rem;
}

.plan-price strong {
  font-size: clamp(2.2rem, 3vw, 3rem);
  color: var(--ink);
}

.plan-price span {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.plan-tagline {
  margin: 0 0 1rem;
  min-height: 3.2rem;
  font-size: 1.02rem;
  font-weight: 700;
}

.plan-card-button {
  width: 100%;
  margin-bottom: 1.25rem;
}

.plan-card-button[disabled] {
  opacity: 0.58;
  cursor: default;
}

.plan-feature-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-feature-list li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--ink);
}

.plan-feature-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-size: 0.95rem;
}

.feature-glass-card {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.feature-glass-card strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.feature-glass-card p {
  margin: 0;
  font-size: 0.92rem;
}

.feature-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 0.7rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  background: rgba(200, 255, 40, 0.16);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(4, 7, 6, 0.58);
  backdrop-filter: blur(12px);
}

.side-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--side-panel-width);
  height: 100vh;
  padding: 1.35rem;
  overflow-y: auto;
  background: var(--surface-strong);
}

.side-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.section-copy {
  margin: 0 0 1.25rem;
}

.info-list {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.info-list div {
  display: grid;
  gap: 0.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

dd,
dt {
  margin: 0;
}

dd {
  font-weight: 700;
  word-break: break-word;
}

.message {
  min-height: 1.25rem;
  margin: 1rem 0 0;
}

.stacked-info {
  display: grid;
  gap: 1rem;
}

.mini-panel {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.mini-panel h3 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
}

.compact-info {
  gap: 0.8rem;
}

.compact-info div {
  padding-bottom: 0.75rem;
}

.help-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  min-width: 112px;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 0 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--accent-ink);
  font: inherit;
  font-weight: 800;
  box-shadow: 0 16px 40px rgba(143, 219, 18, 0.22);
  cursor: pointer;
  z-index: 40;
  transition: right 220ms ease, transform 220ms ease, opacity 220ms ease;
}

.help-drawer {
  position: fixed;
  right: 1.5rem;
  bottom: 5.5rem;
  width: min(360px, calc(100vw - 2rem));
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  z-index: 39;
  transition: right 220ms ease, transform 220ms ease, opacity 220ms ease;
}

.help-fab.panel-shifted,
.help-drawer.panel-shifted {
  right: calc(var(--side-panel-width) + 1.5rem);
}

.help-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.help-list {
  margin: 0;
  padding-left: 1.1rem;
}

.help-list li + li {
  margin-top: 0.55rem;
}

.ghost-icon-button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

@media (max-width: 980px) {
  .dashboard-hero-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-block: 3rem;
  }

  .hero-copy-centered,
  .hero-feature-stack {
    grid-column: auto;
    max-width: 460px;
    justify-self: start;
  }

  .settings-card-grid {
    grid-template-columns: 1fr;
  }

  .subscription-plan-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .login-card {
    padding: 1.5rem;
  }

  .portal-nav-inner {
    min-height: auto;
    padding: 1rem 0;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-user {
    align-items: center;
  }

  .nav-user-button {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-actions {
    justify-content: stretch;
  }

  .nav-actions > * {
    width: 100%;
  }

  .dashboard-hero {
    min-height: auto;
  }

  .overview-title {
    max-width: 11ch;
  }

  .hero-cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-screen {
    min-height: auto;
    padding: 1.5rem 1rem 1.25rem;
  }

  .settings-screen-header {
    flex-direction: column;
    align-items: stretch;
  }

  .side-panel {
    width: min(100vw, 100%);
  }

  .help-fab {
    right: 1rem;
    bottom: 1rem;
  }

  .help-drawer {
    right: 1rem;
    bottom: 4.8rem;
  }

  .help-fab.panel-shifted,
  .help-drawer.panel-shifted {
    right: 1rem;
  }
}
