@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --primary: #f4c720;
  --primary-hover: #e5ba1a;
  --primary-dim: rgba(244, 199, 32, 0.12);
  --primary-border: rgba(244, 199, 32, 0.3);
  --bg-dark: #000000;
  --bg-card: #0d0d0d;
  --bg-input: #111111;
  --bg-elevated: #181818;
  --glass-border: rgba(255, 255, 255, 0.07);
  --text-main: #ffffff;
  --text-dim: #b3b3b3;
  --text-muted: #666666;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
}

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

/* Remove number input spinners */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  /* Subtle star-dust background */
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(244, 199, 32, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(244, 199, 32, 0.03) 0%, transparent 50%);
}

/* ─── Layout ─────────────────────────────── */
.signup-wrapper {
  width: 100%;
  max-width: 520px;
}

/* ─── Header ─────────────────────────────── */
.signup-header {
  text-align: center;
  margin-bottom: 36px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 24px;
}

.brand-logo .logo-text {
  font-family: 'Cinzel', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 2px;
}

.brand-logo .logo-text span {
  color: var(--primary);
}

.brand-tagline {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.signup-title {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.signup-subtitle {
  font-size: 14px;
  color: var(--text-dim);
}

.signup-subtitle .badge {
  display: inline-block;
  background: var(--primary-dim);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
  margin-left: 6px;
  letter-spacing: 0.5px;
}

/* ─── Card ───────────────────────────────── */
.signup-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
}

.signup-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-border), transparent);
}

/* ─── Form Groups ────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.form-group label .required {
  color: var(--primary);
  margin-left: 2px;
}

.form-group label .opt {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  margin-left: 4px;
}

/* ─── Inputs ─────────────────────────────── */
.form-control {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus {
  border-color: var(--primary-border);
  box-shadow: 0 0 0 3px rgba(244, 199, 32, 0.08);
}

.form-control.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.form-control.valid {
  border-color: rgba(34, 197, 94, 0.4);
}

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

select.form-control option {
  background: #1a1a1a;
  color: var(--text-main);
}

/* ─── Field Error Text ───────────────────── */
.field-error {
  display: none;
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
}

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

/* ─── Grid ───────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─── Section Divider ────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 20px;
}

.section-divider span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

/* ─── Toggle Switch ──────────────────────── */
.toggle-container {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}

.toggle-option {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s;
  user-select: none;
}

.toggle-option.active {
  background: var(--primary);
  color: #000;
  font-weight: 600;
}

#serviceToggle { display: none; }

/* ─── Form Sections ──────────────────────── */
.form-section {
  display: none;
}

.form-section.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Phone + OTP Row ────────────────────── */
.phone-row {
  display: flex;
  gap: 10px;
}

.phone-row .form-control {
  flex: 1;
}

.btn-otp {
  height: 48px;
  padding: 0 16px;
  background: var(--primary-dim);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  outline: none;
  flex-shrink: 0;
}

.btn-otp:hover:not(:disabled) {
  background: rgba(244, 199, 32, 0.2);
}

.btn-otp:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-otp.verified {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--success);
  cursor: default;
}

/* OTP Input Box */
.otp-wrapper {
  display: none;
  margin-top: 10px;
}

.otp-wrapper.show { display: flex; gap: 10px; }

.otp-wrapper .form-control {
  letter-spacing: 8px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

.btn-verify-otp {
  height: 48px;
  padding: 0 18px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
  outline: none;
}

.btn-verify-otp:hover { background: var(--primary-hover); }

.otp-status {
  font-size: 12px;
  margin-top: 6px;
}

.otp-status.success { color: var(--success); }
.otp-status.error { color: var(--danger); }

/* OTP Countdown */
.otp-countdown {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ─── Checkbox ───────────────────────────── */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
}

.checkbox-group label {
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-group label a {
  color: var(--primary);
  text-decoration: none;
}

.checkbox-group label a:hover { text-decoration: underline; }

/* ─── Submit Button ──────────────────────── */
.btn-submit {
  width: 100%;
  height: 52px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.1), transparent);
  pointer-events: none;
}

.btn-submit:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(244, 199, 32, 0.25);
}

.btn-submit:active { transform: translateY(0); }

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-submit .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

.btn-submit.loading .btn-text { display: none; }
.btn-submit.loading .spinner { display: block; }

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

/* ─── Footer ─────────────────────────────── */
.signup-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.signup-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.signup-footer a:hover { text-decoration: underline; }

/* ─── Toast ──────────────────────────────── */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  pointer-events: auto;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 280px;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.toast.success {
  background: #0f2318;
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.toast.error {
  background: #1f0d0d;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.toast.info {
  background: #1a1500;
  border: 1px solid var(--primary-border);
  color: var(--primary);
}

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg { flex: 1; }

.toast.hide {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(40px) scale(0.95); }
}

/* ─── Responsive ─────────────────────────── */
@media (max-width: 560px) {
  .signup-card {
    padding: 24px 18px;
    border-radius: 16px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .signup-title { font-size: 18px; }
}
