/* =========================================================
   EMILSE MODAS · AUTH.CSS
   Estilos para páginas de autenticación
   ========================================================= */

/* ---------- AUTH PAGE LAYOUT ---------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: linear-gradient(135deg, #FDF8F5 0%, #F8EDE7 50%, #F5E6DC 100%);
  position: relative;
  overflow: hidden;
}

/* Background decorativo */
.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-bg__shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.auth-bg__shape--1 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, var(--primary-light), var(--cream));
  top: -200px;
  right: -100px;
  animation: float 20s ease-in-out infinite;
}

.auth-bg__shape--2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, var(--cream-dark), var(--camel));
  bottom: -150px;
  left: -100px;
  animation: float 25s ease-in-out infinite reverse;
}

.auth-bg__shape--3 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.15;
  animation: pulse 10s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(30px, -30px) rotate(5deg); }
  50% { transform: translate(-20px, 20px) rotate(-5deg); }
  75% { transform: translate(10px, 10px) rotate(3deg); }
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.15; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.1; }
}

/* ---------- AUTH CONTAINER ---------- */

.auth-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  position: relative;
  z-index: 1;
}

/* ---------- AUTH LOGO ---------- */

.auth-logo {
  display: block;
  transition: transform 0.3s var(--ease);
}

.auth-logo:hover {
  transform: scale(1.05);
}

.auth-logo img {
  height: auto;
  max-width: 200px;
}

/* ---------- AUTH CARD ---------- */

.auth-card {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-7);
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.02),
    0 12px 40px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.8);
  animation: slideUp 0.5s var(--ease);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card__header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-card__header h1 {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: var(--space-2);
}

.auth-card__header p {
  font-size: var(--fs-base);
  color: var(--text-light);
}

.auth-card__header p strong {
  color: var(--primary);
}

/* Icono en header */
.auth-card__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-4);
  background: linear-gradient(135deg, var(--cream), var(--cream-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card__icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--primary);
}

.auth-card__icon--success {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
}

.auth-card__icon--success svg {
  stroke: var(--success);
}

/* ---------- AUTH FORM ---------- */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Form Group */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-group label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--secondary);
}

.form-group label .optional {
  font-weight: 400;
  color: var(--muted);
}

/* Input Wrapper */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  padding: var(--space-4) var(--space-4) var(--space-4) 48px;
  font-size: var(--fs-base);
  font-family: var(--font-body);
  color: var(--text);
  background: var(--surface-2);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  transition: all 0.2s var(--ease);
}

.input-wrapper--code input {
  padding-left: var(--space-4);
  font-size: var(--fs-xl);
}

.input-wrapper input::placeholder {
  color: var(--muted);
}

.input-wrapper input:hover {
  border-color: var(--cream-dark);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(230, 54, 131, 0.1);
}

.input-wrapper input:invalid:not(:placeholder-shown) {
  border-color: var(--error);
}

/* Input Icon */
.input-icon {
  position: absolute;
  left: 14px;
  width: 22px;
  height: 22px;
  stroke: var(--muted);
  pointer-events: none;
  transition: stroke 0.2s var(--ease);
}

.input-wrapper:focus-within .input-icon {
  stroke: var(--primary);
}

/* Toggle Password */
.toggle-password {
  position: absolute;
  right: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.2s var(--ease);
}

.toggle-password:hover {
  background: var(--cream);
}

.toggle-password svg {
  width: 20px;
  height: 20px;
  stroke: var(--muted);
}

/* Password Strength */
.password-strength {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.strength-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: var(--error);
  transition: all 0.3s var(--ease);
}

.password-strength[data-strength="weak"] .strength-bar::after {
  width: 33%;
  background: var(--error);
}

.password-strength[data-strength="medium"] .strength-bar::after {
  width: 66%;
  background: #FF9800;
}

.password-strength[data-strength="strong"] .strength-bar::after {
  width: 100%;
  background: var(--success);
}

.strength-text {
  font-size: var(--fs-xs);
  color: var(--muted);
  min-width: 60px;
}

.password-strength[data-strength="weak"] .strength-text {
  color: var(--error);
}

.password-strength[data-strength="medium"] .strength-text {
  color: #FF9800;
}

.password-strength[data-strength="strong"] .strength-text {
  color: var(--success);
}

/* Form Options */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Checkbox */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-light);
}

.checkbox-wrapper input {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
}

.checkbox-wrapper input:checked + .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.checkmark::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s var(--ease);
}

.checkbox-wrapper input:checked + .checkmark::after {
  transform: rotate(45deg) scale(1);
}

/* Forgot Link */
.forgot-link {
  font-size: var(--fs-sm);
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s var(--ease);
}

.forgot-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ---------- AUTH MESSAGE ---------- */

.auth-message {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  text-align: center;
  animation: fadeIn 0.3s var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-message--error {
  background: #FFEBEE;
  color: var(--error);
  border: 1px solid #FFCDD2;
}

.auth-message--success {
  background: #E8F5E9;
  color: var(--success);
  border: 1px solid #C8E6C9;
}

.auth-message--info {
  background: #E3F2FD;
  color: #1565C0;
  border: 1px solid #BBDEFB;
}

/* ---------- AUTH BUTTON ---------- */

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-base);
  font-weight: 600;
  font-family: var(--font-body);
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}

.auth-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.2));
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.auth-btn:hover::before {
  opacity: 1;
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(230, 54, 131, 0.35);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.3s var(--ease);
}

.auth-btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* Secondary Button */
.auth-btn--secondary {
  background: transparent;
  color: var(--secondary);
  border: 2px solid var(--border);
}

.auth-btn--secondary::before {
  display: none;
}

.auth-btn--secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(230, 54, 131, 0.05);
  box-shadow: none;
}

/* ---------- AUTH DIVIDER ---------- */

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-5) 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  font-size: var(--fs-sm);
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- AUTH LINK ---------- */

.auth-link {
  display: block;
  width: 100%;
  padding: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--text-light);
  text-align: center;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color 0.2s var(--ease);
}

.auth-link strong {
  color: var(--primary);
}

.auth-link:hover {
  color: var(--text);
}

.auth-link:hover strong {
  text-decoration: underline;
}

/* ---------- AUTH BACK ---------- */

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  color: var(--text-light);
  text-decoration: none;
  border-radius: var(--radius-full);
  transition: all 0.2s var(--ease);
}

.auth-back svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s var(--ease);
}

.auth-back:hover {
  color: var(--primary);
  background: rgba(230, 54, 131, 0.08);
}

.auth-back:hover svg {
  transform: translateX(-3px);
}

/* ---------- LOADING STATE ---------- */

.auth-btn.loading {
  pointer-events: none;
}

.auth-btn.loading span {
  opacity: 0;
}

.auth-btn.loading::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 480px) {
  .auth-page {
    padding: var(--space-4);
  }

  .auth-card {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
  }

  .auth-card__header h1 {
    font-size: var(--fs-xl);
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-bg__shape--1 {
    width: 300px;
    height: 300px;
  }

  .auth-bg__shape--2 {
    width: 250px;
    height: 250px;
  }

  .auth-bg__shape--3 {
    display: none;
  }
}







