* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #1f2430;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #eef2ff 0%, #f4f5f7 45%, #e9edf5 100%);
}


.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.04),
    0 20px 48px rgba(16, 24, 40, 0.14);
  padding: clamp(28px, 6vw, 48px);
  text-align: center;
  animation: card-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}


.cf-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  height: 100vh;
  min-height: 100vh;
  padding: 0;
  background: #fff;
  color: #313131;
  line-height: 1.15;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

.main-wrapper {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
}
.main-content {
  margin: 8rem auto;
  padding-right: 2rem;
  padding-left: 2rem;
  width: 100%;
  max-width: 60rem;
}
@media (max-width: 720px) {
  .main-content { margin-top: 4rem; }
}

.cf-host {
  line-height: 125%;
  font-size: 2.5rem;
  font-weight: 600;
}
.cf-h2 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  line-height: 125%;
  font-size: 1.5rem;
  font-weight: 600;
}
.cf-desc {
  margin-top: 0;
  margin-bottom: 2rem;
  line-height: 150%;
  font-size: 1rem;
  font-weight: 400;
}


.cf-turnstile { margin: 0; }
.cf-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 300px;
  max-width: 100%;
  height: 65px;
  padding: 0 13px;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  text-align: left;
}
.cf-check {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  background: #fff;
  border: 1px solid #b7b7b7;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease;
}
.cf-check:hover { border-color: #969696; }
.cf-widget.is-checking .cf-check { border-color: #d7d7d7; cursor: default; }
.cf-widget.is-ok .cf-check,
.cf-widget.is-fail .cf-check { border: none; background: transparent; cursor: default; }
.cf-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.cf-box svg { display: block; }
.cf-widget.is-ok .cf-box svg,
.cf-widget.is-fail .cf-box svg { width: 30px; height: 30px; }

.cf-label {
  flex: 1 1 auto;
  font-size: 15px;
  font-weight: 400;
  color: #313131;
}
.cf-brand {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  line-height: 1;
}
.cf-logo-link { display: block; line-height: 0; }
.cf-logo { width: 74px; height: auto; display: block; }
.cf-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-size: 9px;
  color: #757575;
  white-space: nowrap;
}
.cf-links a {
  font-size: 9px;
  font-weight: 400;
  color: #757575;
  text-decoration: none;
  cursor: pointer;
}
.cf-links a:hover { text-decoration: underline; color: #404041; }
.cf-dot { display: none; }


.cf-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(49, 49, 49, 0);
  border-top-color: #313131;
  border-radius: 50%;
  animation: cf-rotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
@keyframes cf-rotate { to { transform: rotate(360deg); } }


.footer {
  margin: 0 auto;
  padding-right: 2rem;
  padding-left: 2rem;
  width: 100%;
  max-width: 60rem;
  line-height: 1.125rem;
  font-size: 0.75rem;
}
.footer a { font-size: 0.75rem; color: #0051c3; }
.footer-inner {
  display: flex;
  justify-content: center;
  border-top: 1px solid #d9d9d9;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.footer-wrapper { text-align: center; }
.footer-link-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.footer-divider {
  border: 1px solid #d9d9d9;
  height: 12px;
}
.footer-text { color: #595959; }
.ray-id { margin-bottom: 4px; }
.ray-id code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-reduced-motion: reduce) {
  .cf-spinner { animation: none; }
}

.icon {
  position: relative;
  width: clamp(72px, 18vw, 92px);
  height: clamp(72px, 18vw, 92px);
  margin: 0 auto clamp(20px, 5vw, 28px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon[hidden] { display: none; }
.icon svg { width: 100%; height: 100%; display: block; overflow: visible; }

.title {
  margin: 0 0 10px;
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 600;
  letter-spacing: -0.01em;
  animation: text-in 0.5s 0.1s ease both;
}

.desc {
  margin: 0;
  min-height: 1.5em;
  font-size: clamp(13px, 3.6vw, 15px);
  line-height: 1.55;
  color: #5b6472;
  animation: text-in 0.5s 0.18s ease both;
}
@keyframes text-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.refs {
  margin-top: clamp(24px, 6vw, 36px);
  padding-top: 18px;
  border-top: 1px solid rgba(16, 24, 40, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.7;
  color: #8a909c;
  word-break: break-all;
  animation: text-in 0.5s 0.26s ease both;
}


.apply {
  margin-top: clamp(20px, 5vw, 28px);
  padding-top: clamp(20px, 5vw, 28px);
  border-top: 2px solid rgba(16, 24, 40, 0.14);
  text-align: left;
  animation: text-in 0.5s 0.2s ease both;
}
.apply-steps {
  margin: 0;
  padding-left: 1.4em;
  font-size: clamp(17px, 4.4vw, 21px);
  line-height: 1.6;
  color: #3b4252;
}
.apply-steps li { margin-bottom: 16px; }
.apply-steps li:last-child { margin-bottom: 0; }

.apply-steps .key {
  display: inline-block;
  padding: 2px 8px;
  margin: 0 2px;
  border: 1px solid #c3c8d0;
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #f7f8fa;
  color: #21303b;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82em;
  font-weight: 600;
  line-height: 1.2;
  min-width: 1.5em;
  text-align: center;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
  vertical-align: middle;
}
.apply-steps .key-win {
  padding: 4px 7px;
}
.apply-steps .win-logo {
  display: block;
  width: 13px;
  height: 13px;
}


.spinner { animation: rotate 1.4s linear infinite; transform-origin: center; }
.spinner .track { stroke: #e7ebf3; }
.spinner .path {
  stroke: #4f46e5;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash {
  0%   { stroke-dasharray: 1, 150;  stroke-dashoffset: 0; }
  50%  { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
  100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}


.result-svg { animation: pop 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes pop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.draw-circle, .draw-mark {
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
}
.draw-circle { animation: draw 0.55s 0.1s ease forwards; }
.draw-mark   { animation: draw 0.35s 0.55s cubic-bezier(0.65, 0, 0.45, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }


.icon.ok::before, .icon.fail::before {
  content: "";
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  opacity: 0;
  animation: glow 0.7s 0.2s ease both;
}
.icon.ok::before   { background: radial-gradient(circle, rgba(22, 163, 74, 0.18), transparent 70%); }
.icon.fail::before { background: radial-gradient(circle, rgba(220, 38, 38, 0.18), transparent 70%); }

@keyframes glow {
  0%   { opacity: 0; transform: scale(0.7); }
  50%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.1); }
}


.form { margin-top: clamp(18px, 4vw, 24px); }

.progress {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: clamp(18px, 4vw, 24px);
}
.progress-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d3d7df;
  transition: background 0.2s ease, transform 0.2s ease;
}
.progress-dot.is-active { background: #4f46e5; transform: scale(1.25); }
.progress-dot.is-done { background: #a5b4fc; }

.step { animation: text-in 0.35s ease both; }
.step-heading {
  margin: 0 0 16px;
  font-size: clamp(16px, 4.4vw, 19px);
  font-weight: 600;
  color: #1f2430;
  text-align: center;
}

.step-nav {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.btn {
  flex: 1 1 auto;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.status {
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: #5b6472;
}
.status[hidden] { display: none; }
.status.is-done { color: #16a34a; }
.status.is-error { color: #dc2626; }


.final {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 4px;
}
.final[hidden] { display: none; }
.final-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: #eef0ff;
  color: #4f46e5;
}
.final-icon svg { width: 34px; height: 34px; }
.final-icon svg[hidden] { display: none; }

.final-icon.is-failed {
  background: #fee2e2;
  color: #dc2626;
}
.final-icon.is-success {
  background: #dcfce7;
  color: #16a34a;
}
.final-heading { margin-bottom: 10px; }
.final-desc {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: #3b4252;
}
.final-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: #8a909c;
}
.qr {
  display: flex;
  justify-content: center;
  margin: 6px 0 14px;
}
.qr-canvas {
  display: block;
  width: 200px;
  height: 200px;
  padding: 10px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.06);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}


.download {
  flex: 0 0 auto;
  display: inline-block;
  margin: 6px 0 12px;
  padding: 12px 22px;
  text-align: center;
  text-decoration: none;
  min-width: 180px;
}
.download:visited { color: #fff; }

.download[hidden] { display: none; }


.auto-icon-spinner[hidden] { display: none; }
.auto-icon-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid #cfd2f5;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: processing-spin 0.9s linear infinite;
}
@keyframes processing-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .auto-icon-spinner { animation: none; }
}

.processing-text[hidden] { display: none; }
.processing-text {
  margin: 6px 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: #3b4252;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: #4f46e5;
  color: #fff;
}
.btn-primary:hover { background: #4338ca; }
.btn-primary:active { transform: translateY(1px); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary:disabled { background: #4f46e5; }
.btn-primary:disabled:active { transform: none; }
.btn-back {
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid #d0d3d9;
  color: #5b6472;
}
.btn-back:hover { border-color: #b9bdc6; }


.field {
  margin: 14px 0;
  text-align: left;
}
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #5b6472;
}
.field-input {
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #d0d3d9;
  border-radius: 10px;
  font-size: 15px;
  color: #1f2430;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-input::placeholder { color: #98a0ad; }
.field-input:hover { border-color: #b9bdc6; }
.field-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.field-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
}
.field-error[hidden] { display: none; }


.cs {
  position: relative;
  margin: clamp(20px, 5vw, 28px) 0 4px;
  text-align: left;
}
.cs-label-text {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #5b6472;
}
.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #d0d3d9;
  border-radius: 10px;
  font-size: 15px;
  color: #1f2430;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cs-trigger:hover { border-color: #b9bdc6; }
.cs.is-open .cs-trigger {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.cs-value {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cs-value.is-placeholder { color: #98a0ad; }
.cs-caret {
  flex: 0 0 auto;
  color: #8a909c;
  font-size: 12px;
  transition: transform 0.18s ease;
}
.cs.is-open .cs-caret { transform: rotate(180deg); }

.cs-panel {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #e0e3e9;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16);
  overflow: hidden;
  animation: cs-pop 0.16s ease both;
}
@keyframes cs-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cs-search-wrap { padding: 10px; border-bottom: 1px solid #eef0f4; }
.cs-search {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d8dbe2;
  border-radius: 8px;
  font-size: 14px;
  color: #1f2430;
  outline: none;
}
.cs-search:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.cs-list {
  margin: 0;
  padding: 6px;
  max-height: 240px;
  overflow-y: auto;
  list-style: none;
}
.cs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 15px;
  color: #1f2430;
  cursor: pointer;
}
.cs-item:hover,
.cs-item.is-active { background: #f1f2f7; }
.cs-item.is-selected { background: rgba(79, 70, 229, 0.1); font-weight: 600; }
.cs-flag { font-size: 19px; line-height: 1; }
.cs-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-empty {
  padding: 16px 10px;
  text-align: center;
  font-size: 14px;
  color: #98a0ad;
}


.uploads {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.upload-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upload-slot[hidden] { display: none; }
.upload-label {
  font-size: 13px;
  font-weight: 600;
  color: #5b6472;
  text-align: left;
}
.upload-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #fafbfc;
  border: 2px dashed #cdd2db;
  border-radius: 12px;
  color: #8a909c;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.upload-frame:hover {
  border-color: #4f46e5;
  background: #f5f4ff;
}
.upload-frame:focus-visible {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.upload-frame.is-dragover {
  border-color: #4f46e5;
  background: #f0efff;
}
.upload-frame.has-image {
  border-style: solid;
  border-color: #d0d3d9;
  background: #fff;
  cursor: default;
}
.upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
  pointer-events: none;
}
.upload-frame.has-image .upload-prompt { display: none; }
.upload-icon { width: 34px; height: 34px; }
.upload-text { font-size: 13px; font-weight: 600; }
.upload-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f3f4f7;
}
.upload-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  background: #dc2626;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 0;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.25);
  transition: background 0.15s ease, transform 0.1s ease;
}
.upload-remove::before,
.upload-remove::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}
.upload-remove::before { transform: translate(-50%, -50%) rotate(45deg); }
.upload-remove::after { transform: translate(-50%, -50%) rotate(-45deg); }
.upload-remove[hidden] { display: none; }
.upload-remove:hover { background: #b91c1c; }
.upload-remove:active { transform: scale(0.92); }
.upload-caption {
  font-size: 13px;
  font-weight: 600;
  color: #5b6472;
  text-align: center;
}
.upload-caption:empty { display: none; }


@media (prefers-reduced-motion: reduce) {
  .card, .title, .desc, .refs, .result-svg, .draw-circle, .draw-mark,
  .icon.ok::before, .icon.fail::before, .cs-panel {
    animation: none !important;
  }
  .draw-circle, .draw-mark { stroke-dashoffset: 0; }
  .cs-caret { transition: none; }
}
