/* ===================================
   MERCANET - RECUPERAR CONTRASEÑA
   Estilo moderno y consistente
   =================================== */

:root {
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ===== RECOVERY CONTAINER ===== */
.recovery-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ===== BRANDING SIDE ===== */
.recovery-branding {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.recovery-branding::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.branding-content {
  position: relative;
  z-index: 1;
  max-width: 400px;
  margin: 0 auto;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
}

.brand-logo .logo-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  color: var(--white);
}

.brand-logo span {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
}

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

.illustration-circle {
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 3rem;
  color: var(--white);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.brand-text {
  text-align: center;
  margin-bottom: 48px;
}

.brand-text h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
}

.brand-text p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

/* Steps */
.brand-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  opacity: 0.6;
  transition: all 0.3s;
}

.step-item.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

.step-item.completed {
  opacity: 1;
}

.step-number {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  flex-shrink: 0;
}

.step-item.completed .step-number {
  background: var(--success);
}

.step-item span {
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 500;
}

.brand-footer {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8125rem;
  text-align: center;
}

/* ===== FORM SIDE ===== */
.recovery-form-container {
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  overflow-y: auto;
}

.recovery-form-content {
  width: 100%;
  max-width: 420px;
}

.mobile-logo {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.mobile-logo .logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--white);
}

.mobile-logo span {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

/* Progress Mobile */
.progress-mobile {
  display: none;
  margin-bottom: 32px;
}

.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Step Header */
.step-header {
  text-align: center;
  margin-bottom: 32px;
}

.step-icon {
  width: 72px;
  height: 72px;
  background: rgba(30, 64, 175, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.75rem;
  color: var(--primary);
}

.step-icon--success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.step-icon--warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.step-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.step-header p {
  font-size: 0.9375rem;
  color: var(--gray-500);
  line-height: 1.5;
}

.email-sent {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 16px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

/* Alerts */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  font-size: 0.9375rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Form */
.recovery-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group label i {
  color: var(--primary);
  font-size: 0.8125rem;
}

.form-group input:not(.code-input) {
  width: 100%;
  padding: 14px 16px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--gray-800);
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

.form-group input::placeholder {
  color: var(--gray-400);
}

.input-hint {
  font-size: 0.75rem;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Code Inputs */
.code-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.code-input {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.code-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

/* Resend Code */
.resend-code {
  text-align: center;
  margin-top: 8px;
}

.resend-code p {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.resend-code .link-primary {
  font-size: 0.875rem;
}

.countdown {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* Password Input */
.password-input {
  position: relative;
}

.password-input input {
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  padding: 4px;
  transition: color 0.2s;
}

.toggle-password:hover {
  color: var(--gray-600);
}

/* Password Strength */
.password-strength {
  margin-top: 8px;
}

.strength-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 6px;
}

.strength-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: all 0.3s;
}

.strength-fill.weak {
  background: var(--danger);
}

.strength-fill.medium {
  background: var(--warning);
}

.strength-fill.strong {
  background: var(--success);
}

.strength-text {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.match-indicator {
  display: block;
  font-size: 0.75rem;
  margin-top: 6px;
}

/* Password Requirements */
.password-requirements {
  padding: 16px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  margin-top: 8px;
}

.password-requirements h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 10px;
}

.password-requirements ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.password-requirements li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.password-requirements li i {
  font-size: 0.5rem;
  color: var(--gray-300);
  transition: all 0.2s;
}

.password-requirements li.valid {
  color: var(--success);
}

.password-requirements li.valid i {
  color: var(--success);
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 64, 175, 0.4);
}

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

/* Links */
.link-primary {
  color: var(--primary);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

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

/* Form Footer */
.form-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--gray-200);
}

.form-footer p {
  font-size: 0.9375rem;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  font-size: 0.875rem;
  color: var(--gray-500);
  transition: color 0.2s;
}

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

.back-home {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
  font-size: 0.875rem;
  color: var(--gray-500);
  transition: color 0.2s;
}

.back-home:hover {
  color: var(--primary);
}

/* ===== SUCCESS STATE ===== */
.success-container {
  text-align: center;
}

.success-animation {
  margin-bottom: 32px;
}

.success-circle {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--success), #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 2.5rem;
  color: var(--white);
  animation: successPop 0.5s ease;
}

@keyframes successPop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.success-container h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 12px;
}

.success-container > p {
  font-size: 1rem;
  color: var(--gray-500);
  margin-bottom: 32px;
  line-height: 1.6;
}

.security-tips {
  margin-top: 32px;
  padding: 24px;
  background: var(--gray-50);
  border-radius: var(--radius-xl);
  text-align: left;
}

.security-tips h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 16px;
}

.security-tips h4 i {
  color: var(--primary);
}

.security-tips ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.security-tips li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.security-tips li::before {
  content: '•';
  color: var(--primary);
  font-weight: bold;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--gray-800);
  color: var(--white);
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  z-index: 2000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast i {
  color: var(--success);
}

.toast.toast-error i {
  color: var(--danger);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .recovery-container {
    grid-template-columns: 1fr;
  }

  .recovery-branding {
    display: none;
  }

  .recovery-form-container {
    padding: 32px 24px;
  }

  .mobile-logo {
    display: flex;
  }

  .progress-mobile {
    display: block;
  }
}

@media (max-width: 480px) {
  .recovery-form-container {
    padding: 24px 20px;
  }

  .recovery-form-content {
    max-width: 100%;
  }

  .step-header h2 {
    font-size: 1.25rem;
  }

  .step-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .code-inputs {
    gap: 6px;
  }

  .code-input {
    width: 44px;
    height: 52px;
    font-size: 1.25rem;
  }

  .success-circle {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }

  .success-container h2 {
    font-size: 1.5rem;
  }

  .btn {
    padding: 16px 24px;
  }

  .toast {
    left: 16px;
    right: 16px;
    transform: translateX(0) translateY(20px);
  }

  .toast.show {
    transform: translateX(0) translateY(0);
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-step {
  animation: fadeIn 0.5s ease;
}