:root {
  --brand-blue: #2563eb;
  --brand-blue-dark: #1d4ed8;
  --card-bg: #ffffff;
  --page-bg: #e8f1ff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border-color: #dbeafe;
  --error: #dc2626;
  --success: #16a34a;
  --shadow-lg: 0 40px 80px rgba(37, 99, 235, 0.12);
  --shadow-sm: 0 12px 30px rgba(37, 99, 235, 0.18);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  margin: 0;
    min-height: 100vh;
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page {
    width: 100%;
  min-height: 100vh;
  padding: 32px 20px;
    display: flex;
    align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(59, 130, 246, 0.1));
}

.card {
    width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  display: flex;
    flex-direction: column;
  gap: 24px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.12), transparent 55%);
  pointer-events: none;
}

.card__header,
.card__footer {
  position: relative;
  z-index: 1;
  text-align: center;
}

.expo-title {
    margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
}

.expo-subtitle {
  margin: 8px 0 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card__section-title {
  margin: 24px 0 8px;
  font-size: 1.15rem;
    font-weight: 600;
  color: var(--text-primary);
}

.price-tag {
  display: inline-flex;
  margin-top: 4px;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-blue-dark);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.form {
    position: relative;
  z-index: 1;
    display: flex;
    flex-direction: column;
  gap: 10px;
}

.field {
    display: flex;
    flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.field label .required {
  color: var(--brand-blue);
}

.field input,
.field select {
  width: 100%;
  border-radius: 14px;
  border: 1.5px solid var(--border-color);
  background: rgba(255, 255, 255, 0.96);
  padding: 12px 16px;
    font-size: 1rem;
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

.field input::placeholder {
  color: rgba(71, 85, 105, 0.7);
}

.field select:invalid {
  color: rgba(71, 85, 105, 0.6);
}

.error-text {
  min-height: 18px;
  font-size: 0.82rem;
  color: var(--error);
  font-weight: 500;
}

.helper-text {
  margin-top: 4px;
    font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
}

.privacy-notice {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}

.privacy-notice a {
  color: var(--brand-blue);
  text-decoration: underline;
  font-weight: 500;
}

.privacy-notice a:hover {
  color: var(--brand-blue-dark);
  text-decoration: none;
}

.error-inline {
  color: var(--error);
  font-weight: 600;
  margin-top: 8px;
}

.form-actions {
    display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.btn-secondary {
  background: #f3f4f6;
  color: var(--text-primary);
  border: 1.5px solid #d1d5db;
  padding: 1rem 1.25rem;
    border-radius: 0.875rem;
  font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover:not(:disabled) {
  background: #e5e7eb;
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Preview Section */
#previewSection {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: block;
}

#previewSection.hidden {
  display: none !important;
  visibility: hidden !important;
}

#previewSection:not(.hidden) {
  display: block !important;
  visibility: visible !important;
}

/* Form Section */
#formSection.hidden {
  display: none !important;
  visibility: hidden !important;
}

#formSection:not(.hidden) {
  display: block !important;
  visibility: visible !important;
}

.preview-header {
  margin-bottom: 1rem;
}

.back-button {
  background: transparent;
  border: none;
  color: var(--brand-blue);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.5rem 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: opacity 0.2s;
}

.back-button:hover {
  opacity: 0.8;
}

.back-button:active {
  opacity: 0.6;
}

.pass-preview {
  padding: 1.5rem;
  border-radius: 1.5rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1.5px solid rgba(59, 130, 246, 0.18);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.12);
  display: flex !important;
  flex-direction: column;
  gap: 1.5rem;
  visibility: visible !important;
  opacity: 1 !important;
}

.pass-preview__note {
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  text-align: center;
  margin: 0;
}

.pass-preview__note.unpaid {
  background: rgba(234, 179, 8, 0.18);
  color: #92400e;
}

.pass-preview__note.paid {
  background: rgba(16, 185, 129, 0.18);
  color: #065f46;
}

/* QR Container */
.qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  margin: 1rem auto;
  width: 220px;
  height: 220px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  overflow: hidden;
}

/* Canvas styling */
#previewQr {
  display: block !important;
  visibility: visible !important;
  margin: 0 auto;
  width: 160px;
  height: 160px;
  max-width: 100%;
}

.pass-preview__details {
  display: flex !important;
  flex-direction: column;
  gap: 1rem;
  visibility: visible !important;
}

.pass-preview__details > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.pass-preview__details > div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pass-preview__details .label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.pass-preview__details .value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.pass-preview__actions {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  width: 100%;
}

.pass-preview__actions .submit-button {
  width: 100%;
  max-width: 100%;
}

.submit-button {
    border: none;
  border-radius: 18px;
  padding: 16px;
  font-size: 1.05rem;
    font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
  box-shadow: var(--shadow-sm);
    cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-1.5px);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.25);
}

.submit-button:disabled {
  opacity: 0.65;
    cursor: not-allowed;
  box-shadow: none;
}

.card__footer p {
    margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.desktop-notice {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
  padding: 24px;
  z-index: 100;
}

.desktop-card {
  max-width: 420px;
  width: 100%;
  background: #ffffff;
  border-radius: 24px;
  padding: 32px;
    text-align: center;
  box-shadow: var(--shadow-lg);
}

.desktop-card h2 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--text-primary);
}

.desktop-card p {
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.hidden {
  display: none !important;
}

.loading-overlay {
    position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
    flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #ffffff;
  z-index: 90;
}

.loading-spinner {
  width: 48px;
  height: 48px;
    border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  animation: spin 0.9s linear infinite;
}

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

.toast-container {
    position: fixed;
  top: 20px;
  right: 20px;
    display: flex;
    flex-direction: column;
  gap: 12px;
  z-index: 120;
}

.toast {
  min-width: 240px;
  padding: 14px 18px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.15);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--error);
}

.toast.info {
  border-left: 4px solid var(--brand-blue);
}

@media (max-width: 520px) {
  .card {
    padding: 28px 24px;
    border-radius: 24px;
  }

  .expo-title {
    font-size: 1.3rem;
  }

  .price-tag {
  font-size: 1.15rem;
  }

  .form {
    gap: 8px;
  }

  .field {
    gap: 5px;
  }

  .field input,
  .field select {
    font-size: 1rem;
    padding: 10px 14px;
}

  .form-actions {
    flex-direction: column;
    margin-top: 0;
  }

  .qr-container {
    width: 200px;
    height: 200px;
    padding: 1.25rem;
  }

  #previewQr {
    width: 140px;
    height: 140px;
  }

  .pass-preview__body {
    flex-direction: column;
  }

  .pass-preview__details {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

@media (max-width: 360px) {
  .card {
    padding: 24px 20px;
  }

  .form {
    gap: 6px;
  }

  .field {
    gap: 4px;
  }

  .field input,
  .field select {
    padding: 8px 12px;
  }

  .form-actions {
    margin-top: 0;
  }

  .qr-container {
    width: 180px;
    height: 180px;
    padding: 1rem;
  }

  #previewQr {
    width: 120px;
    height: 120px;
  }
}

@media (min-width: 768px) {
  #previewSection {
    max-width: 480px;
  }
  
  .qr-container {
    width: 240px;
    height: 240px;
  }
  
  #previewQr {
    width: 180px;
    height: 180px;
  }
}

