/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --success: #10b981;
  --success-light: #d1fae5;
  --error: #ef4444;
  --error-light: #fee2e2;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--text);
}

/* ===== Container ===== */
.container {
  width: 100%;
  max-width: 440px;
}

/* ===== Header ===== */
.header {
  text-align: center;
  margin-bottom: 24px;
  color: white;
}

.logo {
  font-size: 48px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
  font-size: 14px;
  opacity: 0.85;
}

/* ===== Card ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  display: none;
  animation: slideUp 0.3s ease;
}

.card.active {
  display: block;
}

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

.card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ===== Step Indicator ===== */
.step-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
}

.step.active {
  background: var(--primary);
  color: white;
}

.step.done {
  background: var(--success);
  color: white;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  transition: background 0.3s;
}

.step-line.active {
  background: var(--success);
}

/* ===== Input Group ===== */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  background: white;
}

/* ===== OTP Boxes ===== */
.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.otp-box {
  width: 48px;
  height: 56px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  /* Hide number input arrows */
  -moz-appearance: textfield;
}

.otp-box::-webkit-outer-spin-button,
.otp-box::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.otp-box:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  background: white;
}

.otp-box.filled {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ===== Buttons ===== */
.btn {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

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

.btn-secondary {
  background: var(--bg);
  color: var(--text-muted);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  color: var(--text);
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.link-btn:hover {
  color: var(--primary-hover);
}

/* ===== Loader ===== */
.btn-loader {
  animation: spin 1s linear infinite;
}

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

/* ===== Error Message ===== */
.error-msg {
  background: var(--error-light);
  color: var(--error);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.error-msg::before {
  content: '⚠️';
}

/* ===== Resend Section ===== */
.resend {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Success Card ===== */
.success-card {
  text-align: center;
}

.success-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.success-card h2 {
  color: var(--success);
  font-size: 22px;
  margin-bottom: 8px;
}

.success-card p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.user-info {
  background: var(--success-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
}

.user-info p {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
  word-break: break-all;
}

.user-info p:last-child {
  margin-bottom: 0;
}

/* ===== reCAPTCHA ===== */
#recaptcha-container {
  margin-bottom: 16px;
}

/* ===== Utility ===== */
.hidden {
  display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .card {
    padding: 24px 20px;
  }

  .otp-box {
    width: 42px;
    height: 50px;
    font-size: 18px;
  }

  .otp-inputs {
    gap: 8px;
  }
}
