:root {
  --blue-50: #eff6ff;
  --indigo-50: #eef2ff;
  --purple-50: #faf5ff;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --indigo-600: #4f46e5;
  --purple-600: #9333ea;
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-500: #22c55e;
  --green-700: #15803d;
  --red-50: #fef2f2;
  --red-200: #fecaca;
  --red-600: #dc2626;
  --gray-200: #e5e7eb;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--gray-800);
}

button,
input,
select,
textarea {
  font: inherit;
}

.screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue-50), var(--indigo-50), var(--purple-50));
  display: grid;
  place-items: center;
  padding: 48px 24px;
}

.grid-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.blob {
  position: absolute;
  border-radius: 999px;
  mix-blend-mode: multiply;
  filter: blur(24px);
  pointer-events: none;
}

.blob-one {
  top: 40px;
  left: 40px;
  width: 256px;
  height: 256px;
  background: #93c5fd;
  opacity: 0.2;
  animation: float 6s ease-in-out infinite;
}

.blob-two {
  right: 40px;
  bottom: 40px;
  width: 256px;
  height: 256px;
  background: #c084fc;
  opacity: 0.2;
  animation: float-reverse 8s ease-in-out infinite;
}

.blob-three {
  top: 50%;
  left: 25%;
  width: 128px;
  height: 128px;
  background: #f9a8d4;
  opacity: 0.15;
  animation: float 6s ease-in-out infinite;
}

.container {
  position: relative;
  width: 100%;
  max-width: 768px;
}

.header {
  text-align: center;
  margin-bottom: 40px;
}

.logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  margin-bottom: 8px;
}

.logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.title {
  margin: 0 0 12px;
  font-size: clamp(40px, 7vw, 60px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
  color: transparent;
  background: linear-gradient(90deg, var(--blue-600), var(--indigo-600), var(--purple-600));
  -webkit-background-clip: text;
  background-clip: text;
}

.subtitle {
  max-width: 448px;
  margin: 0 auto;
  color: var(--gray-600);
  font-size: 16px;
}

.glass {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.form-card {
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.14);
}

.form-grid {
  display: grid;
  gap: 24px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 600;
}

.field-icon,
.terms-icon,
.button-icon,
.success-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field-icon {
  width: 16px;
  height: 16px;
  color: var(--blue-500);
  flex: 0 0 auto;
}

.form-input {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--gray-800);
  padding: 12px 16px;
  outline: none;
  transition: all 0.3s ease;
}

.form-input:focus {
  background: #fff;
  border-color: var(--blue-500);
  transform: scale(1.02);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.dob-picker {
  display: grid;
  grid-template-columns: minmax(74px, 0.9fr) minmax(104px, 1.15fr) minmax(88px, 1fr);
  gap: 10px;
}

.dob-box {
  min-height: 50px;
  appearance: none;
  cursor: pointer;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 21px,
    calc(100% - 12px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.dob-box:invalid {
  color: #8a94a6;
}

.address-input {
  resize: none;
  min-height: 112px;
}

.hint {
  margin: 0 0 8px;
  color: var(--gray-500);
  font-size: 12px;
}

.terms-card {
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  padding: 20px;
  text-align: left;
}

.terms-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.terms-icon {
  width: 20px;
  height: 20px;
  color: var(--blue-600);
  flex: 0 0 auto;
}

.terms-heading h2 {
  margin: 0;
  color: var(--gray-800);
  font-size: 20px;
  line-height: 1.25;
}

.terms-scroll {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 8px;
  color: var(--gray-700);
  font-size: 14px;
  line-height: 1.6;
}

.terms-scroll > div + div {
  margin-top: 16px;
}

.terms-scroll h3 {
  margin: 0;
  color: var(--gray-900);
  font-size: 14px;
  font-weight: 700;
}

.terms-scroll p {
  margin: 4px 0 0;
}

.agree-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.7);
  padding: 12px 16px;
  color: var(--gray-800);
  font-size: 14px;
  font-weight: 600;
}

.agree-box input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--blue-600);
}

.error-message {
  display: none;
  border: 1px solid var(--red-200);
  border-radius: 12px;
  background: var(--red-50);
  color: var(--red-600);
  padding: 12px 16px;
  font-size: 14px;
}

.error-message.show {
  display: block;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--blue-600), var(--indigo-600));
  color: #fff;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.2s ease;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -100%;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn-primary:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button-icon {
  width: 20px;
  height: 20px;
}

.success-view {
  position: relative;
  width: 100%;
  max-width: 448px;
}

.success-card {
  width: 100%;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  padding: 48px;
  text-align: center;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.18);
}

.success-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: 999px;
  background: var(--green-100);
  animation: pulse-glow 2s ease-in-out infinite;
}

.success-icon {
  width: 48px;
  height: 48px;
  color: var(--green-500);
}

.success-card h2 {
  margin: 0 0 16px;
  color: var(--gray-800);
  font-size: 30px;
  line-height: 1.2;
}

.success-card p {
  margin: 0 0 32px;
  color: var(--gray-600);
}

.submitted-time {
  margin-bottom: 24px !important;
  border-radius: 12px;
  background: var(--green-50);
  color: var(--green-700) !important;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
}

.submitted-time:empty {
  display: none;
}

.pay-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-600), var(--indigo-600));
  color: #fff;
  padding: 12px 32px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pay-button:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.submit-another {
  display: block;
  width: 100%;
  margin-top: 16px;
  border: 0;
  background: transparent;
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.submit-another:hover {
  color: var(--blue-600);
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes float-reverse {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(20px) rotate(-2deg); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 0 0 20px rgba(59, 130, 246, 0); }
}

@keyframes slide-up {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes slide-down {
  0% { opacity: 0; transform: translateY(-30px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

.animate-slide-up {
  animation: slide-up 0.8s ease-out forwards;
}

.animate-slide-down {
  animation: slide-down 0.8s ease-out forwards;
}

.animate-scale-in {
  animation: scale-in 0.6s ease-out forwards;
}

@media (max-width: 768px) {
  .screen {
    padding: 36px 24px;
  }

  .form-card {
    padding: 32px;
  }

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

@media (max-width: 520px) {
  .screen {
    padding: 28px 16px;
  }

  .header {
    margin-bottom: 28px;
  }

  .form-card,
  .success-card {
    border-radius: 20px;
    padding: 24px;
  }

  .title {
    font-size: 40px;
  }

  .dob-picker {
    grid-template-columns: minmax(64px, 0.85fr) minmax(88px, 1.12fr) minmax(76px, 1fr);
    gap: 8px;
  }

  .dob-box {
    min-height: 58px;
    padding-left: 12px;
    padding-right: 26px;
    font-size: 14px;
    background-position:
      calc(100% - 14px) 25px,
      calc(100% - 9px) 25px;
  }
}
