/* =========================================
   LOGIN - UTOPIA CLUB
   Diseño Profesional Corporativo
   ========================================= */

/* Paleta Corporativa Utopia Club */
:root {
  --utopia-navy: #003f80;
  --utopia-blue: #2c579b;
  --utopia-royal: #004080;
  --utopia-sky: #4c9bb9;
  --utopia-white: #fefeff;

  /* Derivados */
  --utopia-navy-light: #0a4d94;
  --utopia-gradient: linear-gradient(
    135deg,
    #003f80 0%,
    #2c579b 50%,
    #4c9bb9 100%
  );
  --utopia-gradient-accent: linear-gradient(135deg, #4c9bb9 0%, #2c579b 100%);

  /* Sombras */
  --shadow-soft: 0 4px 20px rgba(0, 63, 128, 0.15);
  --shadow-medium: 0 8px 32px rgba(0, 63, 128, 0.2);
  --shadow-strong: 0 12px 48px rgba(0, 63, 128, 0.25);

  /* Texto */
  --text-primary: #1a2942;
  --text-secondary: #4a5568;
  --text-muted: #718096;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
  background: var(--utopia-navy);
}

/* =========================================
   CONTENEDOR PRINCIPAL
   ========================================= */

.login-container {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 10;
  animation: fadeInUp 0.6s ease-out;
}

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

/* =========================================
   CARD DE LOGIN
   ========================================= */

.login-card {
  background: var(--utopia-white);
  border-radius: 20px;
  padding: 48px 40px;
  box-shadow: var(--shadow-strong);
  position: relative;
  overflow: hidden;
}

/* Línea decorativa superior */
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--utopia-gradient);
}

/* Elemento decorativo sutil */
.login-card::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 160px;
  height: 160px;
  background: radial-gradient(
    circle,
    rgba(76, 155, 185, 0.08) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

/* =========================================
   LOGO
   ========================================= */

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo a {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.login-logo a:hover {
  transform: scale(1.03);
}

.tienda-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
}

/* =========================================
   TÍTULO
   ========================================= */

.login-title {
  text-align: center;
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--utopia-navy);
  margin-bottom: 32px;
  letter-spacing: -0.02em;
  position: relative;
}

.login-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--utopia-gradient-accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* =========================================
   FORMULARIO
   ========================================= */

form {
  width: 100%;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

/* =========================================
   INPUTS
   ========================================= */

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background-color: #f8fafc;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-primary);
  transition: all 0.25s ease;
  outline: none;
}

.form-input:hover {
  border-color: #cbd5e1;
  background-color: #ffffff;
}

.form-input:focus {
  border-color: var(--utopia-sky);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(76, 155, 185, 0.12);
}

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

/* =========================================
   PASSWORD GROUP
   ========================================= */

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

.password-input-group .form-input {
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.password-toggle:hover {
  background: rgba(76, 155, 185, 0.1);
  color: var(--utopia-sky);
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

.password-toggle i {
  font-size: 1rem;
}

/* =========================================
   CHECKBOX
   ========================================= */

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 28px;
  cursor: pointer;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid #cbd5e1;
  cursor: pointer;
  accent-color: var(--utopia-blue);
  transition: all 0.2s ease;
}

.form-check-input:hover {
  border-color: var(--utopia-sky);
}

.form-check-input:checked {
  border-color: var(--utopia-blue);
}

.form-check-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.form-check:hover .form-check-label {
  color: var(--text-primary);
}

/* =========================================
   BOTÓN PRINCIPAL
   ========================================= */

.login-btn {
  width: 100%;
  padding: 15px 28px;
  border: none;
  border-radius: 12px;
  background: var(--utopia-gradient);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 63, 128, 0.3);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
}

.login-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.login-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 63, 128, 0.4);
}

.login-btn:hover:not(:disabled)::before {
  left: 100%;
}

.login-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(0, 63, 128, 0.3);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================================
   ENLACES
   ========================================= */

.forgot-password,
.back-home {
  text-align: center;
  margin-top: 16px;
}

.forgot-password a,
.back-home a {
  color: var(--utopia-blue);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.forgot-password a::after,
.back-home a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--utopia-gradient-accent);
  transition: width 0.3s ease;
  border-radius: 1px;
}

.forgot-password a:hover,
.back-home a:hover {
  color: var(--utopia-navy);
}

.forgot-password a:hover::after,
.back-home a:hover::after {
  width: 100%;
}

.back-home {
  margin-top: 12px;
}

.back-home a {
  color: var(--text-muted);
}

.back-home a:hover {
  color: var(--utopia-blue);
}

/* =========================================
   RESPONSIVE - TABLETS
   ========================================= */

@media (max-width: 768px) {
  body {
    padding: 20px;
  }

  .login-card {
    padding: 40px 32px;
    border-radius: 18px;
  }

  .tienda-logo {
    height: 52px;
  }

  .login-title {
    font-size: 1.5rem;
    margin-bottom: 28px;
  }

  .form-group {
    margin-bottom: 18px;
  }

  .form-input {
    padding: 13px 15px;
  }
}

/* =========================================
   RESPONSIVE - MÓVILES
   ========================================= */

@media (max-width: 480px) {
  body {
    padding: 16px;
    align-items: flex-start;
    padding-top: 10vh;
  }

  .login-container {
    max-width: 100%;
  }

  .login-card {
    padding: 32px 24px;
    border-radius: 16px;
  }

  .login-logo {
    margin-bottom: 24px;
  }

  .tienda-logo {
    height: 48px;
  }

  .login-title {
    font-size: 1.375rem;
    margin-bottom: 24px;
  }

  .login-title::after {
    width: 40px;
    margin-top: 10px;
  }

  .form-label {
    font-size: 0.8125rem;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .form-input {
    padding: 12px 14px;
    font-size: 0.875rem;
    border-radius: 10px;
  }

  .password-input-group .form-input {
    padding-right: 46px;
  }

  .password-toggle {
    width: 36px;
    height: 36px;
  }

  .form-check {
    margin: 16px 0 24px;
  }

  .form-check-input {
    width: 17px;
    height: 17px;
  }

  .form-check-label {
    font-size: 0.8125rem;
  }

  .login-btn {
    padding: 14px 24px;
    font-size: 0.9375rem;
    border-radius: 10px;
  }

  .forgot-password,
  .back-home {
    margin-top: 14px;
  }

  .forgot-password a,
  .back-home a {
    font-size: 0.8125rem;
  }
}

/* =========================================
   RESPONSIVE - MÓVILES PEQUEÑOS
   ========================================= */

@media (max-width: 360px) {
  body {
    padding: 12px;
    padding-top: 8vh;
  }

  .login-card {
    padding: 28px 20px;
  }

  .tienda-logo {
    height: 44px;
  }

  .login-title {
    font-size: 1.25rem;
  }

  .form-input {
    font-size: 0.8125rem;
    padding: 11px 12px;
  }
}

/* =========================================
   RESPONSIVE - PANTALLAS GRANDES
   ========================================= */

@media (min-width: 1200px) {
  .login-container {
    max-width: 460px;
  }

  .login-card {
    padding: 52px 44px;
  }

  .tienda-logo {
    height: 60px;
  }

  .login-title {
    font-size: 1.75rem;
  }
}

/* =========================================
   UTILIDADES
   ========================================= */

/* Ocultar scrollbar pero permitir scroll */
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Focus visible para accesibilidad */
.form-input:focus-visible,
.login-btn:focus-visible,
.form-check-input:focus-visible {
  outline: 2px solid var(--utopia-sky);
  outline-offset: 2px;
}

/* Deshabilitar selección en botones */
.login-btn,
.password-toggle {
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* =========================================
   FORGOT PASSWORD - ESTILOS ESPECÍFICOS
   ========================================= */

/* Icono decorativo superior */
.forgot-icon {
  text-align: center;
  margin-bottom: 24px;
}

.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: var(--utopia-gradient);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 63, 128, 0.3);
}

.icon-circle i {
  font-size: 1.75rem;
  color: #ffffff;
}

/* Subtítulo descriptivo */
.login-subtitle {
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 28px;
  padding: 0 8px;
}

/* Título sin línea inferior para forgot password */
.login-title.no-line::after {
  display: none;
}

/* Label con icono */
.form-label i {
  margin-right: 6px;
  color: var(--utopia-sky);
  font-size: 0.8125rem;
}

/* Input con icono */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .form-input {
  padding-right: 46px;
}

.input-with-icon .input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9375rem;
  pointer-events: none;
  transition: color 0.25s ease;
}

.input-with-icon .form-input:focus + .input-icon {
  color: var(--utopia-sky);
}

/* Hint debajo del input */
.form-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.form-hint i {
  color: var(--utopia-sky);
  font-size: 0.6875rem;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Botón con icono */
.login-btn i {
  margin-right: 8px;
}

/* Spinner en el botón */
.login-btn .fa-spinner {
  margin-right: 8px;
}

/* Divider "o" */
.divider {
  display: flex;
  align-items: center;
  margin: 28px 0;
  gap: 16px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

.divider span {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Form Footer */
.form-footer {
  margin-top: 8px;
}

/* Info Box */
.info-box {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(
    135deg,
    rgba(76, 155, 185, 0.08) 0%,
    rgba(44, 87, 155, 0.05) 100%
  );
  border-radius: 12px;
  border: 1px solid rgba(76, 155, 185, 0.15);
  margin-bottom: 20px;
}

.info-box > i {
  color: var(--utopia-sky);
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.info-box > div {
  flex: 1;
}

.info-box strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.info-box p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}

/* Link primario */
.link-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--utopia-blue);
  text-decoration: none;
  transition: all 0.2s ease;
}

.link-primary i {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

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

.link-primary:hover i {
  transform: translateX(3px);
}

/* Back home con icono */
.back-home a i {
  margin-right: 6px;
  transition: transform 0.2s ease;
}

.back-home a:hover i {
  transform: translateX(-3px);
}

/* =========================================
   FORGOT PASSWORD - RESPONSIVE
   ========================================= */

@media (max-width: 480px) {
  .icon-circle {
    width: 64px;
    height: 64px;
  }

  .icon-circle i {
    font-size: 1.5rem;
  }

  .login-subtitle {
    font-size: 0.875rem;
    margin-bottom: 24px;
    padding: 0;
  }

  .divider {
    margin: 24px 0;
  }

  .info-box {
    padding: 14px;
    gap: 12px;
  }

  .info-box > i {
    font-size: 1.125rem;
  }

  .info-box strong {
    font-size: 0.8125rem;
  }

  .info-box p {
    font-size: 0.75rem;
  }

  .link-primary {
    font-size: 0.75rem;
  }
}

@media (max-width: 360px) {
  .icon-circle {
    width: 56px;
    height: 56px;
  }

  .icon-circle i {
    font-size: 1.25rem;
  }

  .login-subtitle {
    font-size: 0.8125rem;
  }

  .info-box {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .info-box > i {
    margin: 0 auto;
  }
}

/* =========================================
   RESET PASSWORD - ESTILOS ESPECÍFICOS
   ========================================= */

/* Wrapper para código + botón reenviar */
.code-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.code-input-wrapper .form-input {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  letter-spacing: 0.25em;
  font-weight: 600;
  font-size: 1.125rem;
}

/* Botón Reenviar Código */
.btn-resend {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  height: auto;
  min-height: 50px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  color: var(--utopia-blue);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.btn-resend:hover:not(:disabled) {
  background: var(--utopia-blue);
  border-color: var(--utopia-blue);
  color: #ffffff;
}

.btn-resend:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-resend:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-resend:focus-visible {
  outline: 2px solid var(--utopia-sky);
  outline-offset: 2px;
}

.btn-resend i {
  font-size: 0.75rem;
}

/* Form footer para reset */
.form-footer {
  margin-top: 24px;
}

.form-footer .forgot-password {
  margin-top: 0;
  margin-bottom: 12px;
}

/* Hint con icono de escudo */
.form-hint .fa-shield-alt {
  color: var(--utopia-sky);
}

/* =========================================
   RESET PASSWORD - RESPONSIVE
   ========================================= */

@media (max-width: 480px) {
  .code-input-wrapper {
    flex-direction: column;
  }

  .code-input-wrapper .form-input {
    font-size: 1rem;
    letter-spacing: 0.2em;
  }

  .btn-resend {
    width: 100%;
    min-height: 46px;
    justify-content: center;
  }
}
