/* =========================================================
   Smart Reminder & Payment Platform — Auth Pages Styles
   ========================================================= */

:root {
  --primary:   #2c3e50;
  --secondary: #3498db;
  --accent:    #e74c3c;
  --light:     #ecf0f1;
  --dark:      #34495e;
  --success:   #27ae60;
  --warning:   #f39c12;
  --muted:     #95a5a6;

  --border-radius-card: 15px;
  --border-radius-btn:  30px;
  --border-radius-sm:   8px;
  --shadow-card: 0 4px 20px rgba(44, 62, 80, 0.10);
  --font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-family);
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, #1a252f 40%, #2d4054 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
}

/* Decorative background shapes */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(52,152,219,0.15), transparent 70%);
  top: -150px;
  right: -100px;
}
body::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(231,76,60,0.10), transparent 70%);
  bottom: -100px;
  left: -80px;
}

/* Auth layout wrapper */
.auth-wrapper {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.auth-wrapper.auth-wide { max-width: 520px; }

/* Brand header above card */
.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}
.auth-brand .brand-logo {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--secondary), #2980b9);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(52,152,219,0.40);
}
.auth-brand h2 {
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 4px;
}
.auth-brand p {
  color: rgba(255,255,255,0.60);
  font-size: 13.5px;
}

/* Auth card */
.auth-card {
  background: #fff;
  border-radius: var(--border-radius-card);
  box-shadow: 0 20px 60px rgba(0,0,0,0.30);
  overflow: hidden;
}

.auth-card .auth-card-header {
  background: linear-gradient(135deg, var(--primary), var(--dark));
  padding: 22px 28px 20px;
}
.auth-card .auth-card-header h4 {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
}
.auth-card .auth-card-header p {
  color: rgba(255,255,255,0.60);
  font-size: 13px;
  margin: 0;
}

.auth-card .auth-card-body { padding: 28px; }
.auth-card .auth-card-footer {
  background: #f8fafb;
  border-top: 1px solid #f0f4f8;
  padding: 16px 28px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}
.auth-card .auth-card-footer a { color: var(--secondary); font-weight: 600; }
.auth-card .auth-card-footer a:hover { color: var(--primary); }

/* Form controls */
.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: block;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #dde3ea;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  font-family: var(--font-family);
  color: var(--dark);
  background: #fff;
  transition: all 0.2s ease;
  outline: none;
}
.form-control:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(52,152,219,0.12);
}
.form-control.is-invalid { border-color: var(--accent); }
.form-control.is-valid   { border-color: var(--success); }
.invalid-feedback {
  font-size: 12px;
  color: var(--accent);
  margin-top: 4px;
  display: none;
}
.form-control.is-invalid ~ .invalid-feedback { display: block; }

.form-group { margin-bottom: 18px; }

.input-group { display: flex; align-items: stretch; }
.input-group .input-group-text {
  padding: 0 12px;
  background: #f4f7fb;
  border: 1.5px solid #dde3ea;
  border-right: none;
  border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
  color: var(--muted);
  font-size: 16px;
  display: flex;
  align-items: center;
}
.input-group .form-control {
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  flex: 1;
}
.input-group .form-control:focus { position: relative; z-index: 1; }

.password-toggle {
  position: relative;
}
.password-toggle .form-control { padding-right: 44px; }
.password-toggle .toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  transition: color 0.2s;
}
.password-toggle .toggle-btn:hover { color: var(--secondary); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--border-radius-btn);
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-family);
  padding: 11px 24px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(52,152,219,0.30);
  width: 100%;
}
.btn-primary:hover {
  background: #2980b9;
  border-color: #2980b9;
  box-shadow: 0 6px 20px rgba(52,152,219,0.45);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}
.btn-outline-secondary {
  background: transparent;
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.80);
}
.btn-outline-secondary:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}

/* Spinner inside button */
.btn .btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.30);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: none;
}
.btn.loading .btn-spinner { display: inline-block; }
.btn.loading .btn-text { opacity: 0.7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Checkbox */
.form-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.form-check-input {
  width: 18px;
  height: 18px;
  border: 1.5px solid #dde3ea;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--secondary);
}
.form-check-label {
  font-size: 13px;
  color: var(--dark);
  cursor: pointer;
  line-height: 1.5;
}
.form-check-label a { color: var(--secondary); font-weight: 600; }

/* Divider with text */
.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}
.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e8ecf0;
}
.divider-text span { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Forgot password link */
.forgot-link {
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.forgot-link:hover { color: var(--secondary); }

/* Alert boxes */
.auth-alert {
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}
.auth-alert-error {
  background: rgba(231,76,60,0.08);
  border: 1px solid rgba(231,76,60,0.20);
  color: #c0392b;
}
.auth-alert-success {
  background: rgba(39,174,96,0.08);
  border: 1px solid rgba(39,174,96,0.20);
  color: #1e8449;
}
.auth-alert-info {
  background: rgba(52,152,219,0.08);
  border: 1px solid rgba(52,152,219,0.20);
  color: #2471a3;
}
.auth-alert .alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* Activation page specifics */
.policy-preview-box {
  background: linear-gradient(135deg, rgba(52,152,219,0.08), rgba(44,62,80,0.05));
  border: 1.5px solid rgba(52,152,219,0.20);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}
.policy-preview-box .ppb-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 6px;
}
.policy-preview-box .ppb-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* Steps indicator */
.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}
.auth-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}
.auth-step::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: #e8ecf0;
}
.auth-step:last-child::after { display: none; }
.auth-step.done::after  { background: var(--secondary); }

.auth-step .step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #e8ecf0;
  background: #fff;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.auth-step.active .step-dot { border-color: var(--secondary); color: var(--secondary); background: rgba(52,152,219,0.08); }
.auth-step.done   .step-dot { border-color: var(--secondary); color: #fff; background: var(--secondary); }
.auth-step .step-label { font-size: 11px; color: var(--muted); font-weight: 600; text-align: center; white-space: nowrap; }
.auth-step.active .step-label { color: var(--secondary); }

/* Toast for auth pages */
#auth-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
}

/* Password strength meter */
.password-strength { margin-top: 8px; }
.strength-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}
.strength-bar .sb-seg {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e8ecf0;
  transition: background 0.3s;
}
.strength-bar .sb-seg.filled-weak   { background: var(--accent); }
.strength-bar .sb-seg.filled-medium { background: var(--warning); }
.strength-bar .sb-seg.filled-strong { background: var(--success); }
.strength-label { font-size: 11px; font-weight: 600; color: var(--muted); }
.strength-label.weak   { color: var(--accent); }
.strength-label.medium { color: var(--warning); }
.strength-label.strong { color: var(--success); }

/* Responsive */
@media (max-width: 480px) {
  .auth-card .auth-card-body { padding: 20px 18px; }
  .auth-card .auth-card-header { padding: 18px 18px 16px; }
  .auth-brand h2 { font-size: 22px; }
}
