:root {
  --bg: #070012;
  --bg-2: #0d0322;
  --bg-3: #140634;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .07);
  --border: rgba(168, 85, 247, .22);
  --border-strong: rgba(236, 72, 153, .36);
  --text: #f3eefc;
  --muted: #a99fc4;
  --muted-2: #786f91;
  --cyan: #22d3ee;
  --purple: #a855f7;
  --violet: #8b5cf6;
  --pink: #ec4899;
  --green: #22c55e;
  --yellow: #facc15;
  --red: #fb7185;
  --grad: linear-gradient(100deg, #22d3ee 0%, #a855f7 48%, #ec4899 100%);
  --grad-text: linear-gradient(100deg, #67e8f9 0%, #c084fc 52%, #f9a8d4 100%);
  --shadow-neon: 0 0 0 1px rgba(168, 85, 247, .28), 0 22px 70px rgba(88, 28, 135, .34);
  --radius: 8px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 680px at 86% -14%, rgba(168, 85, 247, .18), transparent 60%),
    radial-gradient(900px 620px at 6% 0%, rgba(34, 211, 238, .12), transparent 58%),
    linear-gradient(180deg, var(--bg) 0%, #05000d 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .7), transparent 80%);
}

::selection {
  background: rgba(168, 85, 247, .42);
  color: #fff;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 0, 18, .78);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 18px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  filter: drop-shadow(0 0 14px rgba(168, 85, 247, .48));
}

.brand-copy {
  display: grid;
  gap: 0;
  line-height: 1;
}

.brand-kicker {
  color: var(--cyan);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.brand-name,
h1,
h2,
h3,
.eyebrow {
  font-family: Orbitron, Inter, sans-serif;
}

.brand-name {
  font-size: 1.34rem;
  font-weight: 900;
  background: var(--grad-text);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #d8d0ea;
  font-size: .94rem;
}

.top-nav a {
  padding: 8px 0;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  color: var(--cyan);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: 18px;
  padding: 28px 0 18px;
  align-items: start;
}

.tool-panel,
.result-panel,
.privacy-band {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(13, 3, 34, .72);
  box-shadow: var(--shadow-neon);
}

.tool-panel,
.result-panel {
  padding: 22px;
}

.result-panel {
  position: sticky;
  top: 96px;
}

.panel-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4.2vw, 3.3rem);
  line-height: 1.04;
  background: var(--grad-text);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

h3 {
  margin-bottom: 0;
  font-size: .95rem;
}

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: #d8d0ea;
  line-height: 1.55;
}

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

.bot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-section {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-section legend {
  margin-bottom: 10px;
  color: #fff;
  font-size: .9rem;
  font-weight: 800;
}

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

.form-grid legend {
  grid-column: 1 / -1;
}

.field,
.switch-row {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

.field span,
.switch-row strong {
  color: #efe7ff;
  font-size: .83rem;
  font-weight: 700;
}

.switch-row small,
.hint {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.hint {
  margin: 10px 0 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: #fff;
  background: rgba(255, 255, 255, .045);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.55;
}

input[type="file"] {
  padding: 9px 12px;
}

input[type="file"]::file-selector-button {
  min-height: 30px;
  margin-right: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 10px;
  color: #fff;
  background: rgba(168, 85, 247, .22);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #c084fc 50%),
    linear-gradient(135deg, #c084fc 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 12px) 19px;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

select option {
  color: var(--text);
  background-color: var(--bg-2);
}

select option:checked,
select option:hover,
select option:focus {
  color: #fff;
  background-color: var(--bg-3);
}

input::placeholder,
textarea::placeholder {
  color: #776d8f;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, .16);
  background: rgba(255, 255, 255, .07);
}

input:disabled,
textarea:disabled {
  color: var(--muted-2);
  border-color: rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .025);
}

.send-section {
  border: 1px solid rgba(168, 85, 247, .16);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 255, 255, .025);
  transition: border-color .18s ease, background .18s ease, opacity .18s ease;
}

.send-section.is-enabled {
  border-color: var(--border);
  background: rgba(255, 255, 255, .045);
}

.password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.password-control button {
  min-width: 86px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: #efe7ff;
  background: rgba(255, 255, 255, .05);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.preset-button,
.secondary-button,
.ghost-button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: #d8d0ea;
  background: rgba(255, 255, 255, .045);
  transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease;
}

.preset-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.password-control button:hover {
  border-color: var(--purple);
  color: #fff;
  background: rgba(168, 85, 247, .12);
}

.preset-button.is-active {
  border-color: transparent;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 26px rgba(168, 85, 247, .26);
}

.switch-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 58px;
  border: 1px solid rgba(168, 85, 247, .16);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: rgba(255, 255, 255, .03);
}

.switch-row span {
  display: grid;
  gap: 3px;
}

.switch-row input {
  width: 44px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  accent-color: var(--purple);
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: var(--radius);
  padding: 0 18px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 26px rgba(217, 70, 239, .34);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 34px rgba(236, 72, 153, .48);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: .56;
  transform: none;
}

.result-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 11px;
  color: #d8d0ea;
  font-size: .76rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.is-idle {
  background: rgba(255, 255, 255, .04);
}

.status-badge.is-running {
  border-color: rgba(250, 204, 21, .5);
  color: #fde68a;
  background: rgba(250, 204, 21, .1);
}

.status-badge.is-success {
  border-color: rgba(34, 197, 94, .55);
  color: #bbf7d0;
  background: rgba(34, 197, 94, .12);
}

.status-badge.is-error {
  border-color: rgba(251, 113, 133, .55);
  color: #fecdd3;
  background: rgba(251, 113, 133, .12);
}

.summary-box {
  border: 1px solid rgba(168, 85, 247, .16);
  border-radius: var(--radius);
  padding: 12px;
  color: #d8d0ea;
  background: rgba(255, 255, 255, .035);
}

.summary-box p {
  margin: 0;
  line-height: 1.5;
}

.step-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border: 1px solid rgba(168, 85, 247, .13);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(255, 255, 255, .03);
}

.step-dot {
  width: 12px;
  height: 12px;
  margin: 4px auto 0;
  border-radius: 999px;
  background: var(--muted-2);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .035);
}

.step-ok .step-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .14);
}

.step-error .step-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, .14);
}

.step-warn .step-dot {
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(250, 204, 21, .14);
}

.step-title {
  display: block;
  color: #fff;
  font-size: .88rem;
  font-weight: 800;
}

.step-detail {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.transcript-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 8px;
}

.ghost-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: .82rem;
  font-weight: 800;
}

.transcript {
  min-height: 210px;
  max-height: 360px;
  margin: 0;
  overflow: auto;
  border: 1px solid rgba(34, 211, 238, .16);
  border-radius: var(--radius);
  padding: 12px;
  color: #c7f9ff;
  background: rgba(2, 6, 23, .68);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .8rem;
  line-height: 1.52;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.privacy-band {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 18px auto 34px;
  padding: 20px 22px;
}

.privacy-band h2 {
  margin-top: 6px;
}

.privacy-band p:last-child {
  margin: 0;
  color: #d8d0ea;
  line-height: 1.58;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 14px 16px;
  border-top: 1px solid var(--border-strong);
  background: rgba(7, 0, 18, .92);
  backdrop-filter: blur(14px);
  box-shadow: 0 -18px 60px rgba(0, 0, 0, .4);
}

.cookie-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.cookie-inner strong {
  display: block;
  margin-bottom: 4px;
}

.cookie-inner p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}

.cookie-actions {
  display: flex;
  flex-shrink: 0;
  gap: 10px;
}

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

  .result-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 1180px);
  }

  .header-inner {
    min-height: 68px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .top-nav {
    gap: 12px;
    font-size: .84rem;
  }

  .tool-panel,
  .result-panel,
  .privacy-band {
    padding: 16px;
  }

  .form-grid,
  .preset-grid,
  .privacy-band {
    grid-template-columns: 1fr;
  }

  .password-control {
    grid-template-columns: 1fr;
  }

  .password-control button {
    min-height: 40px;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
  }

  body {
    background-attachment: scroll;
  }
}
