:root {
  color-scheme: light;
  font-family: 'Google Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  overflow-y: scroll;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #0f172a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #0f172a;
  color: #fff;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
  font-size: 0.9rem;
  max-width: 320px;
}

.toast--error {
  background: #b91c1c;
}

[hidden] {
  display: none !important;
}

#payment-form {
  padding: clamp(16px, 4vw, 32px);
  flex: 1 0 auto;
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.form-shell {
  max-width: 680px;
  margin: 50px auto 0;
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.form-header {
  margin-bottom: 20px;
}

.form-header h1 {
  margin: 0 0 6px;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 600;
}

.form-header p {
  margin: 0;
  color: #64748b;
  font-size: 0.98rem;
}

.form-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  padding: clamp(18px, 3vw, 28px);
  padding-bottom: clamp(22px, 3vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: clamp(560px, 68vh, 760px);
  position: relative;
}

.widget-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 200px;
  text-align: center;
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(2px);
}

.widget-shell.is-loading .steps-container,
.widget-shell.is-loading .step-actions,
.widget-shell.is-loading .form-header {
  opacity: 0.4;
  pointer-events: none;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(37, 99, 235, 0.2);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.step-indicator {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.6);
}

.step-dot.is-active {
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.step-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.step-label {
  margin: 0;
  flex: 1;
  text-align: center;
}

.step-label.is-active {
  color: #2563eb;
  font-weight: 600;
}

.form-step {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.steps-container {
  min-height: clamp(320px, 42vh, 470px);
}

.step-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 500;
  color: #0f172a;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
}

.service-option input {
  display: none;
}

.service-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: #fff;
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  text-align: center;
  font-size: 0.9rem;
  color: #1e293b;
}

.service-icon {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.service-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.service-option input:checked + .service-card {
  border-color: #2563eb;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
  transform: translateY(-1px);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #1e293b;
}

input,
select {
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 12px;
  padding: 16px 16px;
  font-size: 1.05rem;
  font-family: inherit;
  color: #0f172a;
  background: #fff;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

input.is-invalid,
select.is-invalid {
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.15);
  background: #fff1f2;
}

input.iti__tel-input {
  width: 100%;
}

.iti {
  width: 100%;
}

.iti__selected-dial-code {
  display: none;
}

.iti__selected-flag {
  padding-right: 10px;
}

input:focus,
select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.field-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

.field-error {
  margin: 0;
  font-size: 0.85rem;
  color: #b91c1c;
}

.field-link {
  font-size: 0.85rem;
  color: #2563eb;
  text-decoration: none;
}

.field-link:hover {
  text-decoration: underline;
}

.checkbox-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #1e293b;
  line-height: 1.35;
  width: 100%;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.checkbox-row span {
  display: block;
}

.phone-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
}

.phone-row.is-prefix-hidden {
  grid-template-columns: 1fr;
}

.phone-row select[hidden] {
  display: none;
}

.phone-input {
  display: flex;
  align-items: center;
  gap: 0px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 12px;
  background: #fff;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.phone-input:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.phone-input.is-invalid {
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.15);
  background: #fff1f2;
}

.phone-prefix {
  font-size: 1.05rem;
  color: #0f172a;
  white-space: nowrap;
}

.phone-input input {
  border: none;
  padding: 16px 2px;
  font-size: 1.05rem;
  background: transparent;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.phone-input input:focus {
  outline: none;
  box-shadow: none;
}

.phone-input input.is-invalid,
.phone-input.is-invalid input,
.phone-input.is-invalid input:focus {
  border-color: transparent;
  box-shadow: none;
  background: transparent;
}

.raffle-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
}

.raffle-row select {
  flex: 1 1 auto;
}

.raffle-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 56px;
  white-space: nowrap;
}

.raffle-status.is-active {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
}

.method-option input {
  display: none;
}

.method-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  padding: 5px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: #fff;
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  text-align: center;
  font-size: 0.9rem;
  color: #1e293b;
}

.method-card img {
  width: 160px;
  height: 82px;
  border-radius: 10px;
  object-fit: contain;
  display: block;
}

.method-option input:checked + .method-card {
  border-color: #2563eb;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
  transform: translateY(-1px);
}

.summary {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 14px;
}

.summary-label {
  margin: 0;
  font-size: 0.85rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-value {
  margin: 6px 0 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.hidden {
  display: none;
}

.summary-note {
  font-size: 0.85rem;
  color: #475569;
  max-width: 200px;
  text-align: right;
}

.step-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
  width: 100%;
}

.step-actions button {
  max-width: 100%;
  min-width: 0;
  flex: 0 1 auto;
}

.step-actions .secondary-button {
  margin-right: auto;
}

.step-actions .primary-button,
.step-actions .submit-button {
  margin-left: auto;
}

.secondary-button {
  background: #e2e8f0;
  color: #0f172a;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.secondary-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.secondary-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.primary-button {
  background: #1d4ed8;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.28);
}

.primary-button:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.primary-button:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.35);
  outline-offset: 2px;
}

.form-error {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  font-size: 0.9rem;
}

.submit-button {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
}

.submit-button:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.submit-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.4);
  outline-offset: 2px;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.9;
  transform: none;
}

.submit-button.is-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: submit-spinner-rotate 0.8s linear infinite;
  flex: 0 0 auto;
}

@keyframes submit-spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

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

@media (max-width: 520px) {
  #payment-form {
    width: 100%;
  }

  .form-shell {
    justify-content: flex-start;
  }

  .form-card {
    min-height: auto;
  }

  .steps-container {
    min-height: 320px;
  }

  .step-labels {
    display: none;
  }

  .phone-row {
    grid-template-columns: 1fr;
  }

  .raffle-row {
    flex-direction: row;
    align-items: center;
  }

  .step-labels {
    flex-wrap: wrap;
  }

  .step-label {
    flex: 1 1 40%;
  }

  .summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-note {
    text-align: left;
    max-width: none;
  }
}
