:root {
  color-scheme: dark;
  --background: #08090d;
  --surface: rgba(20, 22, 29, 0.92);
  --surface-light: #1b1e27;
  --line: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --muted: #969baa;
  --primary: #6c5cff;
  --primary-light: #8c7cff;
  --success: #31d692;
  --danger: #ff667a;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 12% 20%, #171534 0, transparent 30%),
    radial-gradient(circle at 90% 80%, #241329 0, transparent 28%),
    var(--background);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.background-glow {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.16;
  pointer-events: none;
}

.glow-one {
  top: -160px;
  right: 5%;
  background: #735cff;
}

.glow-two {
  bottom: -180px;
  left: 10%;
  background: #ff4f70;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 0;
}

.auth-layout {
  min-height: calc(100vh - 84px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
  gap: 46px;
  align-items: center;
}

.intro-panel {
  padding: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 17px;
  font-weight: 850;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 14px;
  background: linear-gradient(135deg, #765fff, #ff4e72);
  box-shadow: 0 10px 30px rgba(108, 92, 255, 0.3);
}

.intro-copy {
  margin: 76px 0 42px;
}

.eyebrow {
  color: var(--primary-light);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.17em;
}

.intro-copy h1,
.welcome-row h1 {
  margin: 18px 0;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.intro-copy p,
.welcome-row p,
.dashboard-card p {
  color: var(--muted);
  line-height: 1.7;
}

.intro-copy p {
  max-width: 650px;
  font-size: 17px;
}

.free-card,
.auth-card,
.dashboard-card,
.action-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.free-card {
  max-width: 620px;
  padding: 22px;
  border-radius: 22px;
}

.free-card strong {
  display: block;
  margin: 13px 0;
  font-size: 24px;
}

.free-badge,
.plan-label,
.role-badge {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(108, 92, 255, 0.16);
  color: #aaa0ff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.free-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: #bec2ce;
  font-size: 13px;
}

.auth-card {
  padding: 25px;
  border-radius: 28px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 15px;
  background: #0d0f14;
}

.tab-button {
  min-height: 47px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab-button.active {
  background: var(--surface-light);
  color: white;
}

.auth-form {
  display: grid;
  gap: 18px;
  padding-top: 28px;
}

.form-heading h2 {
  margin: 0 0 7px;
  font-size: 28px;
}

.form-heading p,
.legal-copy {
  margin: 0;
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  color: #d9dbe3;
  font-size: 13px;
  font-weight: 750;
}

label small {
  color: var(--muted);
  font-weight: 500;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  background: #0d0f14;
  color: white;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 255, 0.13);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.primary-button,
.secondary-button {
  min-height: 52px;
  border-radius: 13px;
  font-weight: 850;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, var(--primary), #8c5cff);
  color: white;
  box-shadow: 0 13px 30px rgba(108, 92, 255, 0.25);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.secondary-button {
  padding: 0 19px;
  border: 1px solid var(--line);
  background: var(--surface-light);
  color: white;
}

.message-box {
  margin-top: 18px;
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.message-box.error {
  border: 1px solid rgba(255, 102, 122, 0.35);
  background: rgba(255, 102, 122, 0.1);
  color: #ff9cab;
}

.message-box.success {
  border: 1px solid rgba(49, 214, 146, 0.35);
  background: rgba(49, 214, 146, 0.1);
  color: #77edbc;
}

.legal-copy {
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
}

.dashboard {
  padding-bottom: 60px;
}

.dashboard-header,
.welcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.dashboard-header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.welcome-row {
  padding: 55px 0 35px;
}

.welcome-row h1 {
  margin: 10px 0 8px;
  font-size: clamp(36px, 5vw, 58px);
}

.welcome-row p {
  margin: 0;
}

.role-badge {
  text-transform: uppercase;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dashboard-card {
  min-height: 280px;
  padding: 27px;
  border-radius: 24px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(108, 92, 255, 0.14);
  color: #aaa0ff;
  font-size: 19px;
}

.dashboard-card h2 {
  margin: 28px 0 8px;
}

.plan-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 28px;
}

.plan-details div {
  padding: 15px;
  border-radius: 15px;
  background: #0d0f14;
}

.plan-details span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.plan-details strong {
  display: block;
  margin-top: 7px;
  font-size: 24px;
}

.usage-number {
  margin: 35px 0 18px;
}

.usage-number strong {
  font-size: 50px;
}

.usage-number span {
  margin-left: 8px;
  color: var(--muted);
}

.progress-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #0d0f14;
}

.progress-value {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #ff5474);
  transition: width 0.5s ease;
}

.usage-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
}

.section-title {
  margin: 42px 0 18px;
  font-size: 19px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.action-card {
  min-height: 180px;
  padding: 22px;
  border-radius: 20px;
  color: white;
  text-align: left;
}

.action-card:disabled {
  cursor: default;
  opacity: 0.8;
}

.action-card > span {
  display: block;
  margin-bottom: 30px;
  color: var(--primary-light);
  font-size: 27px;
}

.action-card strong,
.action-card small {
  display: block;
}

.action-card small {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .intro-copy {
    margin: 50px 0 30px;
  }

  .dashboard-grid,
  .action-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  .intro-panel {
    padding: 12px 5px;
  }

  .intro-copy {
    margin: 38px 0 26px;
  }

  .intro-copy h1 {
    font-size: 40px;
  }

  .auth-card {
    padding: 17px;
    border-radius: 21px;
  }

  .field-grid,
  .dashboard-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header,
  .welcome-row {
    align-items: flex-start;
  }

  .welcome-row {
    padding-top: 38px;
  }

  .dashboard-card {
    min-height: 250px;
  }
}


/* SMTP MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  padding: 20px;
}
.modal-box {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h2 { margin: 0; font-size: 22px; }
.modal-close {
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-light);
  color: white; font-size: 16px;
}
.modal-intro { margin: 0 0 22px; color: var(--muted); line-height: 1.6; }
.smtp-form { display: grid; gap: 16px; }
.smtp-detected {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
}
.smtp-detected.success {
  background: rgba(49,214,146,0.1);
  border: 1px solid rgba(49,214,146,0.3);
  color: #77edbc;
}
.smtp-detected.warn {
  background: rgba(255,200,0,0.1);
  border: 1px solid rgba(255,200,0,0.3);
  color: #ffd766;
}
.smtp-status {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-light);
  font-size: 13px;
  line-height: 1.8;
}
.smtp-ok    { color: #77edbc; }
.smtp-warn  { color: #ffd766; }
.smtp-error { color: #ff9cab; }
.toggle-button {
  padding: 0; border: none; background: none;
  color: var(--primary-light); font-size: 13px; text-align: left; cursor: pointer;
}
.action-card:not([disabled]) { cursor: pointer; opacity: 1; }
.action-card:not([disabled]):hover {
  border-color: var(--primary);
  background: rgba(108,92,255,0.08);
}

.smtp-card {
  padding: 28px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(18px);
  margin-bottom: 32px;
}

.smtp-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--muted);
}

.smtp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.smtp-dot.unverified { background: #ff667a; }
.smtp-dot.verified   { background: #31d692; }
.smtp-dot.saved      { background: #f0a500; }

.smtp-form {
  display: grid;
  gap: 18px;
}

.smtp-advanced {
  color: var(--muted);
  font-size: 13px;
}

.smtp-advanced summary {
  cursor: pointer;
  padding: 8px 0;
  font-weight: 700;
  color: var(--primary-light);
}

.smtp-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.smtp-actions .primary-button {
  flex: 1;
  min-width: 140px;
}

.smtp-actions .secondary-button {
  flex: 1;
  min-width: 160px;
}
