:root {
  --bg: #12100e;
  --bg-elevated: rgba(36, 30, 26, 0.78);
  --ink: #f4ece3;
  --ink-muted: #b8a89a;
  --accent: #e08a4d;
  --accent-strong: #f0a46a;
  --line: rgba(244, 236, 227, 0.12);
  --danger: #ff8f7a;
  --ok: #9dcc9a;
  --radius: 18px;
  --font-sans: 'Instrument Sans', system-ui, sans-serif;
  --font-display: 'Newsreader', Georgia, serif;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(224, 138, 77, 0.22), transparent 55%),
    radial-gradient(900px 600px at 95% 10%, rgba(88, 64, 48, 0.45), transparent 50%),
    linear-gradient(165deg, #1a1613 0%, #0f0d0b 48%, #171310 100%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}

.glow-a {
  width: 280px;
  height: 280px;
  left: -60px;
  bottom: 12%;
  background: rgba(224, 138, 77, 0.16);
  animation: drift 12s ease-in-out infinite;
}

.glow-b {
  width: 220px;
  height: 220px;
  right: -40px;
  top: 28%;
  background: rgba(255, 214, 170, 0.08);
  animation: drift 15s ease-in-out infinite reverse;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(18px, -22px, 0);
  }
}

.shell {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(48px, 12vh, 96px) 0 48px;
}

.brand-block {
  margin-bottom: 28px;
  animation: rise 0.7s ease both;
}

.brand {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(42px, 11vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.headline {
  margin: 0 0 12px;
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sub {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.55;
}

.sub strong {
  color: var(--accent-strong);
  font-weight: 600;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: rise 0.8s ease 0.08s both;
}

.field {
  display: block;
  margin-bottom: 16px;
}

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

.input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 14px;
}

.prefix-picker {
  position: relative;
  flex: 0 0 auto;
}

.prefix-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 76px;
  height: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.prefix-trigger::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-muted);
}

.prefix-trigger:focus,
.prefix-picker.is-open .prefix-trigger {
  border-color: rgba(224, 138, 77, 0.65);
  outline: none;
}

.prefix-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 168px;
  max-height: 240px;
  margin: 0;
  padding: 6px;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #241e1a;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.prefix-menu li {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.prefix-menu li:hover,
.prefix-menu li[aria-selected='true'] {
  background: rgba(224, 138, 77, 0.18);
}

input {
  width: 100%;
  min-width: 0;
  padding: 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

input::placeholder {
  color: rgba(184, 168, 154, 0.65);
}

input:focus {
  border-color: rgba(224, 138, 77, 0.65);
  background: rgba(255, 255, 255, 0.06);
}

.btn {
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn:not(:disabled):active {
  transform: translateY(1px);
}

.btn-ghost {
  flex: 0 0 auto;
  min-width: 108px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 14px;
}

.btn-ghost:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-primary {
  width: 100%;
  margin-top: 4px;
  padding: 15px 16px;
  background: linear-gradient(135deg, var(--accent) 0%, #c86f35 100%);
  color: #1a120c;
  font-size: 16px;
}

.btn-primary:not(:disabled):hover {
  filter: brightness(1.05);
}

.hint {
  min-height: 20px;
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-muted);
}

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

.hint.ok {
  color: var(--ok);
}

.success {
  text-align: center;
  padding: 28px 22px;
}

.success-kicker {
  margin: 0 0 8px;
  color: var(--ok);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.success-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

.success-desc {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.55;
}

.hidden {
  display: none;
}

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

@media (max-width: 420px) {
  .panel {
    padding: 18px;
  }

  .btn-ghost {
    min-width: 96px;
    font-size: 13px;
  }
}
