* {
  box-sizing: border-box;
}

:root {
  --bg: #0B0F14;
  --panel: #111827;
  --panel-2: #0F1722;
  --text: #E5E7EB;
  --muted: #9CA3AF;
  --line: rgba(148, 163, 184, 0.18);
  --primary: #3B82F6;
  --accent: #22D3EE;
  --danger: #F43F5E;
  --success: #22C55E;
  --shadow: rgba(0, 0, 0, 0.45);
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 10%, rgba(59, 130, 246, 0.12), transparent 30%),
    radial-gradient(circle at 85% 18%, rgba(34, 211, 238, 0.08), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.loading-view.active {
  display: grid;
}

.loading-view {
  min-height: 100vh;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.loading-logo {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  box-shadow: 0 0 36px rgba(34, 211, 238, 0.2);
}

.loading-view p {
  color: var(--muted);
  margin-top: 18px;
}

.orb {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.14), transparent 68%);
  pointer-events: none;
}

.auth-view {
  min-height: 100vh;
  padding: 48px 18px;
  display: none;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-view.active {
  display: flex;
}

.auth-bg-glow {
  position: absolute;
  inset: auto auto 55% 50%;
  transform: translateX(-50%);
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.16), rgba(59, 130, 246, 0.08) 35%, transparent 70%);
  pointer-events: none;
}

.auth-panel {
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 1;
  text-align: center;
}

.auth-panel.compact {
  background: rgba(17, 24, 39, 0.86);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 34px;
  box-shadow: 0 30px 90px var(--shadow);
}

.brand-block {
  margin-bottom: 24px;
}

.brand-logo {
  width: 112px;
  height: 112px;
  border-radius: 28px;
  box-shadow: 0 0 42px rgba(34, 211, 238, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.22);
}

.brand-logo.small {
  width: 92px;
  height: 92px;
  margin-bottom: 18px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 18px auto 12px;
  padding: 8px 13px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
  color: #93C5FD;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(34, 211, 238, 0.06));
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-pill.danger {
  color: #FDA4AF;
  border-color: rgba(244, 63, 94, 0.28);
  background: rgba(244, 63, 94, 0.08);
}

.auth-panel h1,
.brand-block h1 {
  margin: 0;
  font-size: clamp(38px, 8vw, 58px);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.brand-block p,
.auth-panel p {
  color: var(--muted);
  line-height: 1.65;
}

.auth-card,
.product-card,
.account-card {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.94), rgba(11, 15, 20, 0.94));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 30px 90px var(--shadow);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.tab-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(34, 211, 238, 0.12));
  color: var(--text);
}

.auth-form {
  text-align: left;
  display: grid;
  gap: 10px;
}

.auth-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 34, 0.82);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 15px;
  outline: none;
}

.auth-form input:focus {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.08);
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border: 0;
  border-radius: 16px;
  min-height: 44px;
  padding: 12px 16px;
  font-weight: 850;
}

.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 18px 40px rgba(59, 130, 246, 0.24);
}

.secondary-btn {
  color: var(--text);
  background: rgba(17, 24, 39, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.ghost-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.message {
  min-height: 20px;
  font-size: 13px;
  margin: 0;
}

.message.error {
  color: #FDA4AF;
}

.message.success {
  color: #86EFAC;
}

.auth-note,
.microcopy,
.muted-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-note {
  margin-top: 16px;
}

.app-header,
.manual-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px clamp(16px, 4vw, 34px);
  background: rgba(11, 15, 20, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.header-title {
  font-weight: 900;
  letter-spacing: -0.03em;
}

.header-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dashboard-main {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 38px 18px 72px;
}

.dashboard-hero {
  padding: 34px;
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(17, 24, 39, 0.86), rgba(11, 15, 20, 0.86));
  border: 1px solid var(--line);
  box-shadow: 0 30px 90px var(--shadow);
}

.dashboard-hero h2 {
  margin: 0 0 12px;
  font-size: clamp(36px, 7vw, 70px);
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.dashboard-hero p {
  color: var(--muted);
  max-width: 640px;
  line-height: 1.65;
}

.email-chip {
  display: inline-flex;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.22);
  color: #BFDBFE;
  font-size: 13px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  margin-top: 18px;
}

.product-card h3,
.account-card h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 5vw, 44px);
  letter-spacing: -0.06em;
}

.product-card p,
.account-card p {
  color: var(--muted);
  line-height: 1.65;
}

.product-card.featured {
  border-color: rgba(59, 130, 246, 0.25);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 45%),
    linear-gradient(180deg, rgba(17, 24, 39, 0.94), rgba(11, 15, 20, 0.94));
}

.card-kicker {
  color: #60A5FA;
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.manual-view.active {
  display: block;
}

.manual-header-title {
  font-weight: 900;
  letter-spacing: -0.03em;
}

.manual-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: calc(100vh - 74px);
}

.manual-nav {
  position: sticky;
  top: 73px;
  align-self: start;
  height: calc(100vh - 73px);
  overflow: auto;
  padding: 18px;
  background: rgba(17, 24, 39, 0.45);
  border-right: 1px solid var(--line);
}

.sections-toggle {
  display: none;
}

.section-list {
  display: grid;
  gap: 8px;
}

.section-list button {
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.section-list button:hover {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.28);
}

.manual-content-shell {
  min-width: 0;
  padding: 28px 18px 72px;
  overflow-x: hidden;
}

.manual-content {
  min-width: 0;
}

.manual-loading {
  text-align: center;
  color: var(--muted);
  padding: 72px 16px;
}

.manual-content .manual {
  max-width: 980px;
  margin: 0 auto;
}

.account-card {
  max-width: 680px;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.account-row span {
  color: var(--muted);
}

.account-row strong {
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .app-header,
  .manual-header {
    align-items: flex-start;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .manual-layout {
    display: block;
  }

  .manual-nav {
    position: sticky;
    top: 73px;
    height: auto;
    max-height: none;
    z-index: 10;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
  }

  .sections-toggle {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    font-weight: 850;
  }

  .section-list {
    display: none;
    margin-top: 10px;
    max-height: 55vh;
    overflow: auto;
  }

  .section-list.open {
    display: grid;
  }

  .manual-content-shell {
    padding: 18px 0 64px;
  }

  .manual-content .manual {
    width: 100%;
  }

  .manual-content .page {
    padding: 42px 20px;
  }

  .manual-content table {
    display: block;
    overflow-x: auto;
  }

  .manual-content .footer {
    position: static;
    margin-top: 32px;
  }
}

@media (max-width: 520px) {
  .auth-panel.compact,
  .auth-card,
  .dashboard-hero,
  .product-card,
  .account-card {
    border-radius: 24px;
    padding: 20px;
  }

  .app-header,
  .manual-header {
    gap: 8px;
  }

  .header-logo {
    width: 36px;
    height: 36px;
  }

  .ghost-btn {
    padding: 9px 11px;
    min-height: 38px;
    font-size: 13px;
  }

  .account-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
