:root {
  /* Light, premium minimal */
  --bg: #f7f8fb;
  --panel: #ffffff;
  --border: #e8ebf0;
  --divider: #edf0f5;
  --text: #0b1220;
  --muted: #6b7280;
  --primary: #1f6fff;
  --primary-2: #52e0b3;
  --error: #e5484d;
  --success: #12a57a;

  --ring: color-mix(in oklab, var(--primary) 28%, transparent);
  --ring-err: color-mix(in oklab, var(--error) 28%, transparent);
  --ring-ok: color-mix(in oklab, var(--success) 28%, transparent);

  --radius-xl: 18px;
  --radius-md: 14px;
  --shadow-soft: 0 14px 40px rgba(16, 24, 40, 0.07);
  --shadow-focus: 0 0 0 6px;

  --grad-ambient: radial-gradient(
      1100px 680px at 20% -10%,
      rgba(31, 111, 255, 0.08),
      transparent 40%
    ),
    radial-gradient(
      1200px 900px at 120% 0%,
      rgba(82, 224, 179, 0.1),
      transparent 45%
    );
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  color: var(--text);
  background: var(--grad-ambient), var(--bg);
  display: grid;
  place-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: min(720px, 92vw);
  padding: 28px 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: clamp(24px, 3.4vw, 36px);
  position: relative;
  overflow: hidden;
}

.panel::after {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(
      600px 100px at 50% 0%,
      rgba(31, 111, 255, 0.1),
      transparent 70%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 20%);
  mix-blend: screen;
  opacity: 0.8;
}

.panel.is-success::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    650px 140px at 50% 0%,
    rgba(18, 165, 122, 0.18),
    transparent 75%
  );
  filter: blur(4px);
}

.panel__header {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.brand {
  display: block;
  height: auto;
  opacity: 0.96;
}
h1 {
  font-size: clamp(21px, 2.6vw, 30px);
  margin: 2px 0 0;
  letter-spacing: -0.2px;
}
.sub {
  color: var(--muted);
  margin: 0;
}
.hint {
  margin-left: 8px;
  font-size: 12px;
  color: #8c93a3;
}

.otp {
  display: grid;
  gap: 16px;
}

.otp__inputs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(8px, 1.4vw, 12px);
  padding: 8px 6px;
  border-bottom: 1px dashed var(--divider);
}

.otp__input {
  width: 100%;
  aspect-ratio: 1 / 1.25;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #fcfdff);
  color: var(--text);
  font-size: clamp(20px, 3.2vw, 28px);
  text-align: center;
  outline: none;
  transition: border-color 0.18s ease, transform 0.08s ease,
    box-shadow 0.18s ease, background 0.2s ease;
  caret-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.02);
}
.otp__input::placeholder {
  color: #c7cbd3;
}
.otp__input:hover {
  border-color: #dfe3ea;
}
.otp__input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus) var(--ring),
    inset 0 0 0 1px rgba(16, 24, 40, 0.03);
  transform: translateY(-1px) scale(1.01);
  background: #fff;
}

/* Shared soft focus cursor */
.otp__cursor {
  --x: 0;
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: calc((100% - 5 * clamp(8px, 1.4vw, 12px)) / 6);
  left: var(--x);
  border-radius: 12px;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(31, 111, 255, 0.1),
    rgba(31, 111, 255, 0)
  );
  border: 1px dashed rgba(31, 111, 255, 0.25);
  transition: opacity 0.22s ease, left 0.18s cubic-bezier(0.2, 0.9, 0.2, 1);
  opacity: 0;
}

/* States */
.otp__input.is-correct {
  border-color: var(--success);
  box-shadow: var(--shadow-focus) var(--ring-ok),
    inset 0 0 0 1px rgba(18, 165, 122, 0.22);
}
.otp__input.is-error {
  border-color: var(--error);
  box-shadow: var(--shadow-focus) var(--ring-err),
    inset 0 0 0 1px rgba(229, 72, 77, 0.22);
}

/* Shake on error */
.otp__inputs.is-shake {
  animation: shake 0.4s ease;
}
@keyframes shake {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-4px);
  }
  40%,
  60% {
    transform: translateX(4px);
  }
}

/* Actions */
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 6px;
}
.left-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.right-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
  cursor: pointer;
  transition: transform 0.06s ease, filter 0.2s ease, opacity 0.2s ease;
}
.chip:hover {
  filter: saturate(1.02);
}
.chip:active {
  transform: translateY(1px);
}
.chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 12px rgba(31, 111, 255, 0.45);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 124px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #f6f9ff, #ecfff8);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 24px rgba(31, 111, 255, 0.1),
    0 10px 24px rgba(82, 224, 179, 0.1);
  cursor: pointer;
  transition: transform 0.06s ease, filter 0.2s ease, opacity 0.2s ease;
}
.btn:hover {
  filter: saturate(1.05);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  border: none;
  box-shadow: 0 12px 28px rgba(31, 111, 255, 0.25),
    0 12px 28px rgba(82, 224, 179, 0.25);
}

.btn__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.16);
  border-top-color: rgba(0, 0, 0, 0.7);
  display: none;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.btn.is-loading .btn__label {
  opacity: 0;
}
.btn.is-loading .btn__spinner {
  display: inline-block;
}

.link {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
}
.link:disabled {
  color: #aab7ff;
  cursor: not-allowed;
}
.muted {
  color: var(--muted);
}

.message {
  min-height: 22px;
  font-size: 14px;
  color: var(--muted);
}
.message.is-error {
  color: var(--error);
}
.message.is-success {
  color: var(--success);
}

/* Modal */
.modal {
  border: none;
  padding: 0;
  background: transparent;
}
.modal::backdrop {
  background: color-mix(in oklab, black 30%, transparent);
  backdrop-filter: blur(2px);
}
.modal__card {
  width: min(420px, 92vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  padding: 22px;
  text-align: center;
}
.modal__icon {
  width: 56px;
  height: 56px;
  margin: 6px auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 28px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 32px rgba(31, 111, 255, 0.25),
    0 14px 32px rgba(82, 224, 179, 0.25);
}

/* Confetti – subtle */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.confetti.is-on {
  opacity: 1;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
