:root {
  --cx-primary: #265fdb;
  --cx-primary-strong: #1547b8;
  --cx-secondary: #6d35e7;
  --cx-dark: #3e2ec9;
  --cx-text: #20263a;
  --cx-muted: #6f768a;
  --cx-bg: #f4f5fb;
  --cx-card: #ffffff;
  --cx-border: #d8dced;
  --cx-soft: #eef3ff;
  --cx-success: #1f8f52;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, sans-serif;
  color: var(--cx-text);
  background: var(--cx-bg);
}

.header {
  background: linear-gradient(90deg, #4f35e4 0%, #392fd0 100%);
  color: #fff;
  padding: 14px 16px;
  box-shadow: 0 8px 20px rgba(57, 47, 208, 0.2);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

.brand img {
  height: 40px;
  width: auto;
  display: block;
}

.main {
  padding: 28px 16px 56px;
}

.hero {
  max-width: 880px;
  margin: 0 auto 22px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 10px;
  color: var(--cx-primary-strong);
  font-size: clamp(1.55rem, 2.8vw, 2.15rem);
  line-height: 1.3;
}

.hero p {
  margin: 0;
  color: #39405a;
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  line-height: 1.65;
}

.hero strong {
  color: #2f3654;
}

.card {
  background: var(--cx-card);
  border: 1px solid rgba(38, 95, 219, 0.08);
  border-radius: 18px;
  box-shadow: 0 16px 42px rgba(23, 35, 79, 0.08);
  padding: 22px;
}

.form-section + .form-section {
  margin-top: 24px;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  color: var(--cx-primary-strong);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 800;
  line-height: 1.2;
}

.form-section-title::before,
.form-section-title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(38, 95, 219, 0.14), rgba(38, 95, 219, 0.28));
}

.form-section-title span {
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.field {
  min-width: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.field--intro {
  padding: 16px 18px;
  border: 1px solid rgba(38, 95, 219, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfcff 0%, #f2f6ff 100%);
}

.field--intro label {
  margin-bottom: 10px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.98rem;
  font-weight: 700;
  color: #20263a;
}

.optional {
  color: var(--cx-muted);
  font-weight: 500;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--cx-border);
  outline: none;
  background: #fff;
  color: var(--cx-text);
  font-size: 15px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6f768a 50%),
    linear-gradient(135deg, #6f768a 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 42px;
}

.field input::placeholder {
  color: #7d8498;
}

.field input:focus,
.field select:focus {
  border-color: rgba(38, 95, 219, 0.68);
  box-shadow: 0 0 0 4px rgba(38, 95, 219, 0.14);
}

.field small,
.field-hint {
  display: block;
  margin-top: 7px;
  color: var(--cx-muted);
  font-size: 0.83rem;
  line-height: 1.45;
}

.field-hint strong {
  color: var(--cx-primary-strong);
}

.field-hint--live {
  color: var(--cx-primary-strong);
  font-weight: 700;
}

.inline-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.upload-panel {
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfcff 0%, #f5f8ff 100%);
  border: 1px dashed rgba(38, 95, 219, 0.25);
}

input[type="file"] {
  padding: 10px 12px;
  background: #fff;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 9px;
  padding: 10px 14px;
  background: #e7edff;
  color: var(--cx-primary-strong);
  font-weight: 700;
  cursor: pointer;
}

.submit-block {
  margin-top: 28px;
  text-align: center;
  padding-top: 6px;
}

.submit-claim {
  margin: 0 0 16px;
  color: #2f3654;
  font-size: clamp(1rem, 1.9vw, 1.15rem);
  line-height: 1.65;
}

.submit-claim strong {
  color: var(--cx-primary-strong);
}

.submit-claim span {
  color: #454d69;
}

.actions {
  display: flex;
  justify-content: center;
  align-items: center;
}

.actions--left {
  justify-content: flex-start;
}

.button {
  border: 0;
  cursor: pointer;
  min-width: 220px;
  padding: 14px 28px;
  border-radius: 12px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--cx-primary) 0%, var(--cx-primary-strong) 100%);
  box-shadow: 0 14px 28px rgba(38, 95, 219, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(38, 95, 219, 0.3);
}

.button:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.button--secondary {
  color: var(--cx-primary-strong);
  background: #e8efff;
  box-shadow: none;
}

.button--secondary:hover {
  box-shadow: none;
}

.note {
  margin-top: 12px;
  color: var(--cx-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.note--center {
  text-align: center;
}

.summary-card {
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(38, 95, 219, 0.12);
  background: linear-gradient(180deg, #fbfcff 0%, #f5f8ff 100%);
}

.summary-card h2 {
  margin: 0 0 8px;
  color: var(--cx-primary-strong);
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
}

.summary-card p {
  margin: 0;
  color: #46506b;
  line-height: 1.6;
}

.summary-card--success {
  border-color: rgba(31, 143, 82, 0.2);
  background: linear-gradient(180deg, rgba(31, 143, 82, 0.05) 0%, rgba(245, 248, 255, 1) 100%);
}

.summary-card--error {
  border-color: rgba(200, 42, 42, 0.16);
  background: linear-gradient(180deg, rgba(200, 42, 42, 0.05) 0%, rgba(255, 251, 251, 1) 100%);
}

.summary-lead {
  margin-bottom: 18px;
}

.credential-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 18px;
}

.credential-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(38, 95, 219, 0.1);
}

.credential-item--full {
  grid-column: 1 / -1;
}

.credential-item--meta {
  background: #f8faff;
}

.credential-label {
  display: block;
  margin-bottom: 6px;
  color: var(--cx-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.credential-value {
  display: block;
  color: var(--cx-text);
  font-size: 1rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.credential-value--link a {
  color: var(--cx-primary-strong);
  text-decoration: none;
}

.credential-value--link a:hover {
  text-decoration: underline;
}

.result {
  margin-top: 20px;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--cx-border);
  background: #fbfcff;
}

.result.ok {
  border-color: rgba(31, 143, 82, 0.28);
  background: rgba(31, 143, 82, 0.05);
}

.result.err {
  border-color: rgba(200, 42, 42, 0.22);
  background: rgba(200, 42, 42, 0.04);
}

.kv {
  display: grid;
  grid-template-columns: minmax(120px, 170px) 1fr;
  gap: 8px 14px;
  align-items: start;
}

.k {
  color: var(--cx-muted);
  font-size: 13px;
  font-weight: 700;
}

.v {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.footer {
  padding: 16px;
  text-align: center;
  color: var(--cx-muted);
  font-size: 12px;
}

.cx-processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(38, 95, 219, 0.18);
  backdrop-filter: blur(7px);
}

.cx-processing-overlay[hidden] {
  display: none;
}

.cx-processing-card {
  width: min(460px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(246,249,255,0.99));
  border: 1px solid rgba(38, 95, 219, 0.12);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(38, 95, 219, 0.2);
  overflow: hidden;
}

.cx-processing-card-body {
  padding: 22px;
}

.cx-processing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  color: #fff;
  background: linear-gradient(90deg, #4f35e4 0%, #265fdb 100%);
}

.cx-processing-brand-logos {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cx-processing-brand-logos img {
  height: 34px;
  width: auto;
}

.cx-processing-brand-text {
  min-width: 0;
}

.cx-processing-brand-text strong,
.cx-processing-brand-text span {
  display: block;
}

.cx-processing-brand-text strong {
  font-size: 15px;
  line-height: 1.2;
}

.cx-processing-brand-text span {
  margin-top: 2px;
  font-size: 12px;
  opacity: 0.9;
}

.cx-processing-title {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.15;
  color: var(--cx-text);
}

.cx-processing-text {
  margin: 0;
  color: var(--cx-muted);
  font-size: 15px;
  line-height: 1.5;
}

.cx-processing-status {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cx-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(38, 95, 219, 0.16);
  border-top-color: var(--cx-primary);
  animation: cx-spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.cx-processing-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 14px;
  color: var(--cx-primary-strong);
  font-weight: 700;
}

.cx-processing-progress {
  margin-top: 16px;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(38, 95, 219, 0.12);
}

.cx-processing-progress > span {
  display: block;
  width: 50%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cx-primary), var(--cx-secondary));
  animation: cx-indeterminate 1.2s ease-in-out infinite;
}

.cx-processing-hint {
  margin-top: 14px;
  font-size: 13px;
  color: var(--cx-muted);
}

@media (min-width: 820px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .credential-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inline-fields {
    grid-template-columns: 0.7fr 1.3fr;
  }

  .card {
    padding: 24px 24px 26px;
  }
}

@media (max-width: 640px) {
  .header {
    padding: 12px 14px;
  }

  .brand {
    justify-content: flex-start;
  }

  .brand-left {
    justify-content: flex-start;
  }

  .card {
    padding: 16px;
  }

  .form-section-title {
    gap: 8px;
    font-size: 1.05rem;
  }

  .form-section-title span {
    white-space: normal;
    text-align: center;
  }

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

  .button {
    width: 100%;
  }
}

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

@keyframes cx-indeterminate {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(220%);
  }
}
