:root {
  color-scheme: dark;
  --bg: #070b16;
  --card: rgba(14, 20, 36, 0.82);
  --card-strong: rgba(16, 24, 42, 0.94);
  --line: rgba(226, 232, 240, 0.13);
  --line-strong: rgba(226, 232, 240, 0.24);
  --text: #f8fafc;
  --muted: #a8b3c7;
  --soft: #6f7b90;
  --accent: #86ffd9;
  --accent-2: #9ab8ff;
  --danger: #ff8ca0;
  --warning: #ffd58c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(134, 255, 217, 0.17), transparent 30vw),
    radial-gradient(circle at 86% 20%, rgba(154, 184, 255, 0.18), transparent 33vw),
    linear-gradient(135deg, #070b16 0%, #0b1122 54%, #080b14 100%);
  overflow-x: hidden;
}

button,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.glow {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  filter: blur(46px);
  opacity: 0.28;
}

.glow-left {
  width: 320px;
  height: 320px;
  left: -120px;
  bottom: 16vh;
  background: #86ffd9;
}

.glow-right {
  width: 360px;
  height: 360px;
  right: -120px;
  top: 16vh;
  background: #7393ff;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 24px));
  min-height: 0;
  margin: 0 auto;
  padding: clamp(8px, 1.4vw, 16px) 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 8px 10px;
}

.top > div:nth-child(2) {
  min-width: 0;
  flex: 1 1 360px;
}

.announcement {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 540px;
  min-height: 34px;
  max-width: 100%;
  padding: 8px 13px;
  border: 1px solid rgba(255, 213, 140, 0.3);
  border-radius: 999px;
  color: var(--warning);
  background: rgba(255, 213, 140, 0.08);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  overflow: visible;
  text-align: center;
  white-space: normal;
}

.logo {
  width: 52px;
  height: 52px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 18px;
  color: #061018;
  background: linear-gradient(135deg, var(--accent), #f3fff8);
  box-shadow: 0 18px 45px rgba(134, 255, 217, 0.18);
}

.logo svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.eyebrow,
.label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -0.035em;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 16px;
  align-items: stretch;
}

.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(17, 24, 42, 0.9), rgba(8, 12, 24, 0.78));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  padding: clamp(16px, 2.1vw, 22px);
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pill.success {
  border-color: rgba(134, 255, 217, 0.42);
  color: var(--accent);
  background: rgba(134, 255, 217, 0.09);
}

.pill.warning {
  border-color: rgba(255, 213, 140, 0.42);
  color: var(--warning);
  background: rgba(255, 213, 140, 0.09);
}

.pill.error {
  border-color: rgba(255, 140, 160, 0.42);
  color: var(--danger);
  background: rgba(255, 140, 160, 0.09);
}

textarea,
select {
  width: 100%;
  outline: none;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: rgba(3, 7, 18, 0.48);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 150px;
  resize: vertical;
  border-radius: 20px;
  padding: 14px;
  line-height: 1.55;
}

select {
  height: 42px;
  border-radius: 14px;
  padding: 0 14px;
}

textarea:focus,
select:focus {
  border-color: rgba(134, 255, 217, 0.76);
  box-shadow: 0 0 0 4px rgba(134, 255, 217, 0.11);
}

textarea::placeholder {
  color: rgba(168, 179, 199, 0.6);
}

.field {
  margin-top: 12px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-hint {
  margin: 6px 2px 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.6;
}

.mailbox-box,
.output {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  padding: 14px;
}

.mailbox-box strong,
.output strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mailbox-box p,
.output p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.tip-box {
  margin-top: 12px;
  border: 1px solid rgba(134, 255, 217, 0.24);
  border-radius: 16px;
  padding: 10px 12px;
  color: var(--accent);
  background: rgba(134, 255, 217, 0.07);
  font-size: 13px;
  font-weight: 850;
}

.warning-text {
  color: var(--warning) !important;
}

.soft-note {
  margin: 8px 2px 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.6;
}

.captcha-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid rgba(154, 184, 255, 0.24);
  border-radius: 18px;
  padding: 11px 12px;
  background: rgba(154, 184, 255, 0.07);
}

.captcha-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.captcha-copy strong {
  color: var(--text);
  font-size: 13px;
}

.captcha-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.turnstile-widget {
  min-height: 65px;
  flex: 0 0 auto;
}

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

.primary,
.ghost,
.small {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 880;
  transition: transform 150ms ease, opacity 150ms ease;
}

.primary {
  color: #061018;
  background: linear-gradient(135deg, var(--accent), #f3fff8);
  box-shadow: 0 16px 38px rgba(134, 255, 217, 0.18);
}

.ghost,
.small {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.danger {
  color: var(--danger);
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

.lang-toggle {
  width: 48px;
  height: 38px;
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.status-line {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 8px 0 12px;
}

.dot {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.dot.active,
.dot.done {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.value-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.value-row strong,
.code-output strong {
  font-size: clamp(26px, 3.3vw, 38px);
  letter-spacing: -0.05em;
}

.code-output strong {
  color: var(--accent);
}

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

.small.subtle {
  color: var(--accent);
  background: rgba(134, 255, 217, 0.08);
}

.inline-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

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

.session-actions .ghost {
  flex: 1 1 180px;
}

.history-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.history-head span {
  display: block;
  margin-top: 5px;
  color: var(--soft);
  font-size: 12px;
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
  padding-right: 4px;
}

.history-empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 10px;
  color: var(--soft);
  font-size: 13px;
  text-align: center;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: start;
  border: 1px solid rgba(226, 232, 240, 0.1);
  border-radius: 16px;
  background: rgba(3, 7, 18, 0.26);
  padding: 10px;
}

.history-main {
  min-width: 0;
}

.history-main strong,
.history-main span,
.history-order,
.history-side span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-main strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.history-main span,
.history-order,
.history-side span:last-child {
  display: block;
  margin-top: 4px;
  color: var(--soft);
  font-size: 12px;
}

.history-side {
  min-width: 76px;
  text-align: right;
}

.history-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  font-weight: 900;
}

.history-status.received {
  color: var(--accent);
  background: rgba(134, 255, 217, 0.1);
}

.history-status.waiting_code,
.history-status.pending,
.history-status.timeout {
  color: var(--warning);
  background: rgba(255, 213, 140, 0.1);
}

.history-status.failed {
  color: var(--danger);
  background: rgba(255, 140, 160, 0.1);
}

.history-status.canceled,
.history-status.replaced {
  color: var(--accent-2);
  background: rgba(154, 184, 255, 0.1);
}

.history-order {
  grid-column: 1 / -1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 40;
  width: max-content;
  max-width: min(560px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 16px;
  color: var(--text);
  background: rgba(13, 20, 36, 0.95);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(12px);
}

.modal.show {
  display: grid;
}

.modal-card {
  position: relative;
  width: min(480px, 100%);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--card-strong);
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  font-size: 24px;
  line-height: 1;
}

.modal-code {
  margin: 18px 0 12px;
  padding: 16px;
  border-radius: 22px;
  color: #061018;
  background: linear-gradient(135deg, var(--accent), #f3fff8);
  font-size: clamp(42px, 13vw, 76px);
  font-weight: 950;
  letter-spacing: 0.08em;
}

.modal-sms {
  color: var(--muted);
  line-height: 1.65;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .top > div:nth-child(2) {
    flex-basis: calc(100% - 116px);
  }

  .announcement {
    order: 4;
    width: 100%;
    flex-basis: 100%;
    border-radius: 18px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 18px, 1120px);
    padding: 12px 0 18px;
  }

  .top {
    flex-wrap: wrap;
    padding: 12px 4px;
  }

  .announcement {
    order: 4;
    width: 100%;
    flex-basis: 100%;
    max-width: 100%;
    justify-content: center;
    border-radius: 18px;
  }

  .lang-toggle {
    width: 44px;
    height: 36px;
  }

  .logo {
    width: 50px;
    height: 50px;
    border-radius: 17px;
  }

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

  .card-head,
  .value-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions,
  .session-actions,
  .primary,
  .ghost,
  .small {
    width: 100%;
  }

  .inline-actions {
    width: 100%;
  }

  .inline-actions .small {
    flex: 1 1 0;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .history-side {
    text-align: left;
  }

  .captcha-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .turnstile-widget,
  .turnstile-widget > div {
    max-width: 100%;
  }
}
