:root {
  color-scheme: light;
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-soft: #f7f8fb;
  --ink: #15171c;
  --muted: #68707c;
  --line: #d9dee7;
  --blue: #2563eb;
  --blue-dark: #1746b8;
  --green: #0f8f72;
  --amber: #d99118;
  --danger: #b42318;
  --success: #087443;
  --shadow: 0 28px 80px rgba(32, 42, 58, 0.16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(15, 143, 114, 0.1), transparent 42%),
    var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(21, 23, 28, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 23, 28, 0.045) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 78%);
  animation: gridDrift 18s linear infinite;
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 42px 22px;
}

.workspace {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(380px, 460px);
  gap: 34px;
  align-items: center;
  animation: pageEnter 0.72s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.intro {
  min-width: 0;
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #394150;
  font-size: 14px;
  font-weight: 800;
  animation: softRise 0.62s cubic-bezier(0.2, 0.8, 0.2, 1) 0.05s both;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.2);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 680px;
  margin-top: 26px;
  font-size: 64px;
  line-height: 1;
  letter-spacing: 0;
  animation: softRise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.12s both;
}

.subtitle {
  max-width: 520px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.7;
  animation: softRise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both;
}

.preview {
  position: relative;
  height: 190px;
  margin-top: 44px;
  animation: softRise 0.78s cubic-bezier(0.2, 0.8, 0.2, 1) 0.28s both;
}

.preview-card {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.primary-card {
  left: 0;
  top: 0;
  width: min(440px, 82%);
  height: 132px;
  padding: 24px;
  animation: floatPrimary 5.8s ease-in-out infinite;
}

.secondary-card {
  left: 170px;
  top: 86px;
  width: min(360px, 62%);
  height: 78px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  animation: floatSecondary 6.4s ease-in-out infinite;
}

.preview-label {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(15, 143, 114, 0.12);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.preview-line {
  display: block;
  width: 54%;
  height: 10px;
  margin-top: 18px;
  border-radius: 999px;
  background: #c8d0dc;
  overflow: hidden;
  position: relative;
}

.preview-line::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  transform: translateX(-100%);
  animation: shimmer 2.6s ease-in-out infinite;
}

.preview-line.long {
  width: 78%;
}

.preview-dot {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--amber);
  animation: pulseDot 2.8s ease-in-out infinite;
}

.tool-area {
  display: grid;
  gap: 14px;
}

.view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(216, 222, 231, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px);
}

.view-tab {
  height: 38px;
  border-radius: 6px;
  background: transparent;
  color: #586171;
  box-shadow: none;
  font-size: 13px;
}

.view-tab:hover {
  box-shadow: none;
}

.view-tab.active {
  background: #18202e;
  color: #fff;
  box-shadow: 0 10px 24px rgba(24, 32, 46, 0.16);
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: panelEnter 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.panel {
  width: 100%;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  animation: panelEnter 0.76s cubic-bezier(0.2, 0.8, 0.2, 1) 0.18s both;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.panel:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: 0 34px 90px rgba(32, 42, 58, 0.2);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.compact-head {
  padding-bottom: 16px;
}

.kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  margin-top: 6px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border: 1px solid rgba(15, 143, 114, 0.22);
  border-radius: 999px;
  background: rgba(15, 143, 114, 0.1);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  animation: badgeGlow 3.2s ease-in-out infinite;
}

.muted-badge {
  border-color: rgba(104, 112, 124, 0.22);
  background: rgba(104, 112, 124, 0.08);
  color: #4f5866;
}

.download-form,
.query-form {
  display: grid;
  gap: 10px;
  padding-top: 20px;
}

.query-form {
  padding-top: 16px;
}

label {
  color: #353c48;
  font-size: 13px;
  font-weight: 850;
}

.input-shell {
  position: relative;
  transition: transform 0.18s ease;
}

.redeem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 8px;
  margin-bottom: 4px;
}

.input-shell:focus-within {
  transform: translateY(-1px);
}

.input-shell::before {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  content: "";
  transform: translateY(-50%);
  box-shadow: 0 0 0 6px rgba(15, 143, 114, 0.12);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.code-shell::before {
  background: var(--amber);
  box-shadow: 0 0 0 6px rgba(217, 145, 24, 0.12);
}

.input-shell:focus-within::before {
  background: var(--blue);
  box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.13);
  transform: translateY(-50%) scale(1.08);
}

input,
button {
  width: 100%;
  height: 48px;
  border-radius: 8px;
  font: inherit;
}

input {
  border: 1px solid var(--line);
  padding: 0 16px 0 42px;
  color: var(--ink);
  background: var(--surface-soft);
  outline: none;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
}

input::placeholder {
  color: #9aa2af;
}

input:focus {
  border-color: rgba(37, 99, 235, 0.72);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

button {
  position: relative;
  overflow: hidden;
  border: 0;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.28);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

button::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: translateX(-120%);
}

.secondary-button {
  height: 48px;
  background: #18202e;
  box-shadow: 0 14px 30px rgba(24, 32, 46, 0.2);
}

.secondary-button:hover {
  box-shadow: 0 18px 36px rgba(24, 32, 46, 0.27);
}

button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(37, 99, 235, 0.34);
}

button:hover::after {
  animation: buttonSweep 0.8s ease;
}

button:active {
  transform: translateY(0);
}

button:disabled {
  background: #8e98a8;
  box-shadow: none;
  cursor: wait;
  transform: none;
}

.download-action {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

#submit-button {
  width: 150px;
  height: 46px;
}

.download-form.is-loading #submit-button::before {
  width: 15px;
  height: 15px;
  display: inline-block;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  vertical-align: -3px;
  animation: spin 0.82s linear infinite;
}

.download-form.is-verifying .secondary-button::before,
.query-form.is-querying .secondary-button::before {
  width: 14px;
  height: 14px;
  display: inline-block;
  margin-right: 7px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  vertical-align: -3px;
  animation: spin 0.82s linear infinite;
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  transition: color 0.2s ease, transform 0.2s ease;
}

.status-block {
  min-height: 42px;
}

.status-hint {
  min-height: 0;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.status-hint.show {
  opacity: 1;
  transform: translateY(0);
}

.query-result {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.query-result[hidden] {
  display: none;
}

.result-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid rgba(216, 222, 231, 0.72);
  border-radius: 8px;
  background: rgba(247, 248, 251, 0.78);
}

.result-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.result-row strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.status-result-row {
  background: #fff;
}

.status-pill {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.used {
  background: rgba(180, 35, 24, 0.1);
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.2);
}

.status-pill.unused {
  background: rgba(8, 116, 67, 0.11);
  color: #087443;
  border: 1px solid rgba(8, 116, 67, 0.2);
}

.status-pill.neutral {
  background: rgba(104, 112, 124, 0.1);
  color: #4f5866;
  border: 1px solid rgba(104, 112, 124, 0.2);
}

.status.error {
  color: var(--danger);
  animation: statusPop 0.24s ease both;
}

.status.success {
  color: var(--success);
  animation: statusPop 0.24s ease both;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes panelEnter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gridDrift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 38px 38px, 38px 38px;
  }
}

@keyframes floatPrimary {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -8px, 0);
  }
}

@keyframes floatSecondary {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(8px, 6px, 0);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  48%,
  100% {
    transform: translateX(100%);
  }
}

@keyframes pulseDot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(217, 145, 24, 0.26);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(217, 145, 24, 0);
  }
}

@keyframes badgeGlow {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(15, 143, 114, 0);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(15, 143, 114, 0.08);
  }
}

@keyframes buttonSweep {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(120%);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes statusPop {
  from {
    opacity: 0.55;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 860px) {
  .shell {
    align-items: start;
    padding: 24px 16px;
  }

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

  h1 {
    margin-top: 22px;
    font-size: 46px;
  }

  .subtitle {
    font-size: 17px;
  }

  .preview {
    display: none;
  }

  .panel {
    padding: 20px;
  }

}

@media (max-width: 480px) {
  .shell {
    padding: 18px 12px;
  }

  .brand-row {
    font-size: 13px;
  }

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

  h1 {
    font-size: 34px;
  }

  .subtitle {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.55;
  }

  .panel {
    padding: 16px;
  }

  .tool-area {
    gap: 12px;
  }

  .redeem-row {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 8px;
  }

  .panel-head {
    align-items: center;
    padding-bottom: 16px;
  }

  h2 {
    font-size: 19px;
  }

  input,
  button {
    height: 44px;
  }

  input {
    font-size: 13px;
    padding-left: 38px;
  }

  .input-shell::before {
    left: 14px;
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 5px rgba(15, 143, 114, 0.12);
  }

  .secondary-button {
    height: 44px;
    font-size: 13px;
  }

  .download-action {
    justify-content: center;
  }

  #submit-button {
    width: 168px;
    height: 44px;
    font-size: 14px;
  }

  .status-block {
    min-height: 40px;
  }

  .result-row {
    grid-template-columns: 70px minmax(0, 1fr);
    min-height: 36px;
    padding: 8px 9px;
  }

  .result-row strong {
    font-size: 12px;
  }

  .status-pill {
    min-height: 26px;
    padding: 4px 9px;
  }
}
