:root {
  color-scheme: dark;
  --accent: #8b5cf6;
  --accent-2: #7c3aed;
  --bg: #0b0b10;
  --panel: rgba(23, 22, 31, 0.86);
  --panel-strong: rgba(31, 29, 42, 0.94);
  --line: rgba(224, 220, 236, 0.12);
  --text: #f4f2f8;
  --muted: #a6a0b6;
  --green: #6ee7b7;
  --red: #fb7185;
  --amber: #fbbf24;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

@font-face {
  font-family: "Congord";
  src: url("/fonts/congord/Congord-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  letter-spacing: 0;
}

body.no-animations *, body.no-animations *::before, body.no-animations *::after {
  animation: none !important;
  transition: none !important;
}

.bg-motion {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(180deg, rgba(139, 92, 246, 0.08), transparent 310px),
    linear-gradient(135deg, #0b0b10 0%, #11101a 52%, #0b0b10 100%);
}

button, input, select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  outline: none;
  transition: border 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus, select:focus {
  border-color: color-mix(in srgb, var(--accent) 80%, white 10%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

select option {
  background: #160f22;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1340px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

body.locked .shell {
  filter: blur(14px);
  pointer-events: none;
  user-select: none;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(5, 3, 10, 0.52);
  backdrop-filter: blur(18px);
}

body.locked .auth-screen {
  display: grid;
}

.auth-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 24px;
  background: rgba(26, 18, 41, 0.86);
  box-shadow: var(--shadow), 0 0 80px color-mix(in srgb, var(--accent) 12%, transparent);
  display: grid;
  gap: 14px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand img {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
}

.auth-brand h1 {
  margin: 0 0 4px;
  font-size: 38px;
}

.auth-brand p, .auth-note {
  margin: 0;
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-tab {
  min-height: 42px;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
}

.auth-tab.active {
  color: white;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

.google-button {
  min-height: 48px;
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.google-button span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 50%;
  color: #13091f;
  background: white;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.divider::before, .divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.auth-submit {
  width: 100%;
}

.top-nav, .panel, .stat-card, .account-pill {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.top-nav {
  position: sticky;
  top: 18px;
  z-index: 20;
  display: grid;
  grid-template-columns: 260px 1fr 220px;
  gap: 16px;
  align-items: center;
  min-height: 68px;
  border-radius: 14px;
  padding: 12px 14px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand img {
  display: none;
}

.brand strong {
  display: block;
  font-size: 18px;
  font-weight: 720;
}

.brand span, .account-pill small, .subtitle, .panel-head p, .empty, .hint, .meta {
  color: var(--muted);
}

.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-tab {
  min-height: 38px;
  border-radius: 10px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  transition: color 160ms ease, background 160ms ease;
}

.nav-tab:hover, .nav-tab.active {
  color: white;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.account-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: none;
}

.logout-button {
  margin-left: auto;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.page {
  display: none;
  padding-top: 26px;
  animation: lift 180ms ease both;
}

.page.active {
  display: block;
}

@keyframes lift {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-row, .section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 2px 20px;
}

.section-head.split {
  align-items: center;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

.subtitle {
  margin: 0;
  font-size: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 16px;
}

.panel {
  border-radius: 14px;
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.state-chip, .badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 11px;
  color: #10081b;
  background: var(--green);
  font-size: 12px;
}

.mode-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.mode-tabs.large {
  width: min(420px, 100%);
}

.mode-tab {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 15px;
  color: var(--muted);
  background: transparent;
}

.mode-tab.active {
  color: white;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

.generator-line {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
  margin: 20px 0 14px;
}

.generated-output, .generated-display {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.generated-output {
  padding: 20px;
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 700;
  word-break: break-word;
}

.generated-display {
  margin-top: 22px;
  padding: 24px;
}

.generated-display span {
  display: block;
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 700;
  word-break: break-word;
}

.generated-display small {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.primary, .secondary {
  min-height: 42px;
  border-radius: 10px;
  padding: 0 18px;
  color: white;
  transition: background 150ms ease, border 150ms ease;
}

.primary {
  background: var(--accent);
}

.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.secondary.danger {
  color: #ffd7e2;
}

.primary:hover {
  background: var(--accent-2);
}

.secondary:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: rgba(255, 255, 255, 0.11);
}

.small {
  min-height: 38px;
  padding: 0 14px;
}

.stats-column {
  display: grid;
  gap: 12px;
}

.stat-card {
  border-radius: 14px;
  padding: 18px;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 9px;
  font-size: 30px;
}

.recent-list, .message-list, .alias-grid, #addressList {
  display: grid;
  gap: 10px;
}

.email-row, .message-card, .address-card, .alias-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.045);
  transition: border 150ms ease, background 150ms ease;
}

.email-row:hover, .message-card:hover, .address-card:hover, .alias-card:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, transparent);
  background: rgba(255, 255, 255, 0.065);
}

.row-main {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.row-main strong {
  word-break: break-word;
}

.row-main p, .alias-card p, .message-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.message-status {
  display: inline-flex;
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.form-grid, .settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.inbox-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 360px;
  gap: 16px;
}

.address-sidebar {
  align-self: start;
}

.address-sidebar input {
  margin-bottom: 12px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar input {
  flex: 1;
}

.message-card {
  width: 100%;
  color: var(--text);
  text-align: left;
}

.message-card.unread strong::after {
  content: " new";
  color: var(--green);
  font-size: 12px;
}

.preview-panel {
  min-height: 420px;
}

.preview-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.alias-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alias-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mini {
  min-height: 34px;
  border-radius: 12px;
  padding: 0 11px;
}

.badge.permanent { color: #eadeff; background: color-mix(in srgb, var(--accent) 18%, transparent); }
.badge.disposable { color: #111827; background: var(--green); }
.badge.disabled { color: #210710; background: var(--red); }
.badge.expired { color: #1b0d06; background: var(--amber); }

.countdown {
  color: var(--green);
}

.empty {
  border: 1px dashed rgba(222, 205, 255, 0.22);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
}

.toggle-row input {
  width: 46px;
  height: 24px;
  accent-color: var(--accent);
}

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  display: grid;
  gap: 10px;
}

.toast {
  width: min(390px, calc(100vw - 44px));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(24, 14, 38, 0.96);
  box-shadow: var(--shadow);
  animation: toastIn 220ms ease both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

body.compact .panel,
body.compact .stat-card,
body.compact .email-row,
body.compact .message-card,
body.compact .address-card,
body.compact .alias-card {
  border-radius: 16px;
  padding: 13px;
}

@media (max-width: 1160px) {
  .top-nav {
    grid-template-columns: 1fr;
  }

  .account-pill {
    justify-self: stretch;
  }

  .dashboard-grid, .inbox-layout, .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 1480px);
    padding-top: 10px;
  }

  .top-nav, .panel {
    border-radius: 22px;
  }

  .hero-row, .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .generator-line, .form-grid, .alias-grid {
    grid-template-columns: 1fr;
  }

  .toolbar, .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-tabs {
    justify-content: flex-start;
  }
}
