/* Checkout page — isolated Vanilla implementation */
:root {
  color-scheme: dark;
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
  background: #111827;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #111827; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: #111827; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
[hidden] { display: none !important; }

.checkout-page {
  min-height: 100vh;
  padding: 0 8px 96px;
  color: #fff;
  background: #111827;
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
}

.checkout-header {
  position: sticky;
  z-index: 50;
  top: 0;
  width: 100%;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(15, 23, 42, .95);
  backdrop-filter: blur(20px);
}

.checkout-header__inner {
  display: flex;
  width: 100%;
  max-width: 448px;
  height: 40px;
  align-items: center;
  justify-content: flex-start;
  margin: 0 auto;
}

.checkout-back {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  transition: background 180ms ease;
}
.checkout-back:hover { background: rgba(255, 255, 255, .2); }
.checkout-back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.checkout-timer {
  display: flex;
  width: 100%;
  height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  border-radius: 6px;
  background: #1f2430;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.checkout-container { width: 100%; max-width: 448px; margin: 0 auto; }
.checkout-event-card {
  display: flex;
  min-height: 131px;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  padding: 24px;
  border-radius: 6px;
  background: #1f2430;
}
.checkout-event-copy { flex: 1; text-align: right; }
.checkout-event-copy h1 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}
.checkout-event-copy p { margin: 0 0 5px; color: #9ca3af; font-size: 14px; }
.checkout-event-copy strong { color: #d1d5db; font-size: 14px; font-weight: 500; }

.checkout-form-card { padding: 16px; border-radius: 6px; background: #1f2430; }
.checkout-fields h2,
.checkout-terms h3 {
  margin: 0 0 20px;
  color: #fff;
  font-size: 18px;
  line-height: 28px;
  text-align: right;
}
.checkout-fields h2 { font-weight: 400; }
.checkout-terms h3 { font-weight: 700; }
.checkout-field-label { display: block; margin: 0 0 7px; color: #fff; font-size: 14px; text-align: right; }
.checkout-country-wrap { position: relative; z-index: 5; margin-bottom: 16px; }
.checkout-phone-field {
  display: flex;
  width: 100%;
  height: 38px;
  flex-direction: row-reverse;
  align-items: center;
  overflow: hidden;
  border: 1px solid #4b5563;
  border-radius: 6px;
  background: #1f2736;
  direction: ltr;
}
.checkout-phone-field input {
  height: 100%;
  min-width: 0;
  flex: 1;
  padding: 8px 10px;
  border: 0;
  outline: 0;
  color: #fff;
  background: #1f2736;
  font-size: 14px;
  direction: ltr;
}
.checkout-phone-field button {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 0;
  border-left: 1px solid #4b5563;
  color: #fff;
  background: #1f2736;
  font-size: 13px;
  direction: ltr;
}
.checkout-chevron { color: #9ca3af; font-size: 12px; }
.checkout-input {
  display: block;
  width: 100%;
  height: 38px;
  margin-bottom: 16px;
  padding: 8px;
  border: 1px solid #4b5563;
  border-radius: 6px;
  outline: none;
  color: #fff;
  background: #1f2430;
  font-size: 14px;
  text-align: left;
  direction: ltr;
}
.checkout-input:focus,
.checkout-phone-field:focus-within { border-color: #3b82f6; }
.checkout-input::placeholder,
.checkout-phone-field input::placeholder { color: #9ca3af; opacity: 1; }
.checkout-input.is-invalid,
.checkout-phone-field.is-invalid { border-color: #ef4444; box-shadow: 0 0 0 1px rgba(239, 68, 68, .18); }
.checkout-input.is-invalid { margin-bottom: 4px; }
.checkout-field-error { margin: -12px 0 16px; color: #fca5a5; font-size: 11px; line-height: 1.45; text-align: right; }
.checkout-country-wrap + .checkout-field-error { margin-top: -12px; }

.checkout-country-menu {
  position: absolute;
  z-index: 80;
  right: 0;
  top: calc(100% + 6px);
  left: 0;
  overflow: hidden;
  border: 1px solid #4b5563;
  border-radius: 8px;
  background: #111827;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
  transform-origin: top center;
  animation: checkout-menu-in 160ms cubic-bezier(.23, 1, .32, 1);
}
.checkout-country-menu > input {
  display: block;
  width: calc(100% - 16px);
  height: 36px;
  margin: 8px;
  padding: 7px 10px;
  border: 1px solid #4b5563;
  border-radius: 6px;
  outline: none;
  color: #fff;
  background: #1f2937;
  font-size: 13px;
  text-align: right;
}
.checkout-country-menu > input:focus { border-color: #3b82f6; }
.checkout-country-list {
  max-height: 250px;
  overflow-y: auto;
  border-top: 1px solid #374151;
  scrollbar-color: #4b5563 #111827;
  scrollbar-width: thin;
}
.checkout-country-list button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid rgba(75, 85, 99, .32);
  color: #fff;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  text-align: right;
}
.checkout-country-list button:hover,
.checkout-country-list button[aria-selected="true"] { background: #1f2937; }
.checkout-country-list button b { flex: 0 0 auto; color: #cbd5e1; direction: ltr; font-weight: 500; }
.checkout-country-name { display: flex; min-width: 0; align-items: center; gap: 9px; }
.checkout-country-empty { padding: 18px; color: #9ca3af; font-size: 13px; text-align: center; }
@keyframes checkout-menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.checkout-divider { height: 1px; margin-top: 15px; background: #374151; }
.checkout-terms { padding: 32px 0 0; }
.checkout-terms p {
  height: 256px;
  margin: 0;
  overflow-y: auto;
  color: #f3f4f6;
  font-size: 14px;
  line-height: 1.375;
  text-align: right;
  scrollbar-color: #2b2b2b #1f2937;
  scrollbar-width: thin;
}
.checkout-consent { display: flex; align-items: flex-start; gap: 8px; margin-top: 20px; color: #fff; font-size: 14px; cursor: pointer; }
.checkout-consent input { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 4px; accent-color: #3b82f6; }
.checkout-consent:has(input:focus-visible) { outline: 2px solid #60a5fa; outline-offset: 3px; border-radius: 2px; }

.checkout-paybar {
  position: fixed;
  z-index: 60;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 16px;
  border-top: 1px solid #374151;
  background: #000;
}
.checkout-pay { display: block; width: 100%; padding: 0; border: 0; border-radius: 8px; color: #fff; background: transparent; font-family: inherit; }
.checkout-pay__gradient { display: block; width: 100%; padding: 1px; border-radius: 8px; background: linear-gradient(90deg, #3b82f6, #a855f7, #f97316); }
.checkout-pay__inner {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border-radius: 7px;
  color: #fff;
  background: #030712;
  font-size: 14px;
  text-align: center;
  transition: background 180ms ease;
}
.checkout-pay:hover .checkout-pay__inner { background: #101827; }
.checkout-pay__inner svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.checkout-message {
  position: absolute;
  right: 16px;
  bottom: 72px;
  left: 16px;
  max-width: 448px;
  margin: 0 auto;
  padding: 9px 12px;
  border: 1px solid #4b5563;
  border-radius: 6px;
  color: #fff;
  background: #1f2430;
  font-size: 12px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

@media (max-width: 520px) {
  .checkout-page { padding-inline: 8px; }
  .checkout-header { padding: 12px 8px; }
  .checkout-header__inner { height: 40px; }
  .checkout-timer { margin-top: 10px; font-size: 14px; }
  .checkout-event-card { min-height: 116px; margin: 16px 0; padding: 20px; }
  .checkout-event-copy h1 { font-size: 18px; }
  .checkout-form-card { padding: 16px 12px; }
  .checkout-paybar { padding: 12px; }
}

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