.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-container {
  background: #fff;
  border-radius: 1.5rem;
  padding: 2.5rem;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.4s ease;
}

/* Custom scrollbar styles */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #0b3c5d;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #0b3c5d;
}

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #0b3c5d transparent;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.2s;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.modal-close:hover {
  color: #1f2937;
  background: #f3f4f6;
}

.modal-icon {
  text-align: center;
  color: #c8a24a; /* gold-dark */
  margin-bottom: 1rem;
}

.success-icon {
  color: #16a34a;
}

.modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a3a5c; /* brand */
  text-align: center;
  margin-bottom: 0.5rem;
}

.modal-subtitle {
  text-align: center;
  color: #4b5563;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
  padding: 0.75rem 1rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 1rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  outline: none;
}

.form-group input:focus {
  border-color: #c8a24a;
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.15);
}

.checkbox-group {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #c8a24a;
}

.checkbox-group label {
  font-weight: 400;
  font-size: 0.875rem;
  color: #6b7280;
}

.btn-primary {
  display: inline-block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: #1a3a5c;
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
  text-align: center;
  text-decoration: none;
}

.btn-primary:hover {
  background: #2a5a8c;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Spin Wheel */
.spin-wheel-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 1.5rem auto;
}

#spin-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 6px solid #1a3a5c;
  box-shadow:
    0 0 0 4px #c8a24a,
    0 10px 30px rgba(0, 0, 0, 0.2);
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  display: block;
  background: #fff;
}

.spin-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid #c8a24a;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  z-index: 2;
}

.btn-spin {
  margin-top: 0.5rem;
  background: #c8a24a;
}

.btn-spin:hover {
  background: #d4a017;
}

/* Result */
.spin-result {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #c8a24a;
  background: #fffbeb;
  border: 2px dashed #c8a24a;
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.claim-code-box {
  text-align: center;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.claim-code-box p {
  font-size: 0.875rem;
  color: #166534;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.claim-code {
  font-family: "Courier New", monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: #15803d;
}

.modal-note {
  font-size: 0.9rem;
  color: #4b5563;
  text-align: center;
  margin-bottom: 1rem;
}

.btn-claim {
  background: #16a34a;
  margin-bottom: 1rem;
}

.btn-claim:hover {
  background: #15803d;
}

.modal-disclaimer {
  text-align: center;
  color: #9ca3af;
  font-size: 0.75rem;
  line-height: 1.4;
}

/* Loading */
.modal-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border-radius: 1.5rem;
  z-index: 10;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top-color: #c8a24a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 480px) {
  .modal-container {
    padding: 1.5rem;
  }
  .modal-title {
    font-size: 1.35rem;
  }
  .spin-wheel-container {
    width: 220px;
    height: 220px;
  }
  .spin-wheel .segment span {
    font-size: 0.5rem;
    max-width: 70px;
  }
}
