/**
 * login.css — Estilos modernos, ultra livianos y optimizados para la pantalla de Login
 * Nutrición SaaS — Healthy Tech
 */

:root {
  --ub-primary: #008080;
  --ub-primary-dark: #075B5F;
  --ub-primary-hover: #006F6F;
  --ub-petroleo: #063A40;
  --ub-green: #45B85A;
  --ub-green-light: #EAF7F0;
  --ub-bg-light: #F7FBFA;
  --ub-surface: #FFFFFF;
  --ub-border: #DCE8E6;
  --ub-border-focus: #008080;
  --ub-text: #183438;
  --ub-muted: #657577;
  --ub-error: #B42318;
  --ub-radius: 12px;
  --ub-radius-lg: 20px;
  --ub-radius-xl: 24px;
}

/* Reset de pantalla de login */
body.login-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--ub-bg-light);
  color: var(--ub-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Layout de 2 columnas para Desktop */
.login-layout {
  display: grid;
  grid-template-columns: 58% 42%;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

/* =====================================================
   COLUMNA IZQUIERDA: PROPUESTA DE VALOR & BENEFICIOS
   ===================================================== */
.login-hero-col {
  background: var(--ub-bg-light);
  border-right: 1px solid var(--ub-border);
  padding: clamp(32px, 5vw, 64px) clamp(24px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}

.login-hero-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 680px;
}

/* Marca / Logo superior */
.hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #EAF7F4 0%, #D8F2EC 100%);
  color: var(--ub-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-brand-icon svg {
  width: 24px;
  height: 24px;
}

.hero-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.hero-brand-title {
  font-size: 22px;
  font-weight: 750;
  color: var(--ub-petroleo);
  letter-spacing: -0.02em;
}

.hero-brand-sub {
  font-size: 13px;
  color: var(--ub-muted);
  font-weight: 500;
}

/* Título principal */
.hero-headline {
  margin: 0;
  font-size: clamp(32px, 3.8vw, 52px);
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-headline .line-1 {
  display: block;
  color: var(--ub-petroleo);
}

.hero-headline .line-2 {
  display: block;
  color: var(--ub-green);
}

/* Párrafo explicativo */
.hero-desc {
  margin: 0;
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.5;
  color: var(--ub-muted);
  max-width: 580px;
}

/* Cuadrícula 2x2 de beneficios */
.hero-benefits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 4px;
}

.benefit-item {
  background: #FFFFFF;
  border: 1px solid var(--ub-border);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.benefit-item:hover {
  transform: translateY(-2px);
  border-color: #C0DBD6;
  box-shadow: 0 6px 18px rgba(0, 128, 128, 0.06);
}

.benefit-icon-box {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 14px;
  background: #EAF7F4;
  color: var(--ub-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.benefit-icon-box svg {
  width: 22px;
  height: 22px;
}

.benefit-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.benefit-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ub-text);
  letter-spacing: -0.01em;
}

.benefit-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ub-muted);
}

/* Bloque visual con la Única Fotografía y microbeneficios */
.hero-visual-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--ub-border);
  border-radius: var(--ub-radius-xl);
  padding: 16px;
  box-shadow: 0 4px 20px rgba(7, 48, 50, 0.04);
  max-width: 680px;
}

.hero-photo-wrapper {
  width: 100%;
  height: 135px;
  border-radius: 18px;
  overflow: hidden;
  background: #EAF7F4;
  position: relative;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 18px;
}

.hero-quote-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-quote {
  font-size: 14px;
  font-weight: 600;
  color: var(--ub-petroleo);
  line-height: 1.4;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-quote::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  border-radius: 4px;
  background: var(--ub-green);
  flex-shrink: 0;
}

.micro-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.micro-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ub-primary-dark);
  background: var(--ub-green-light);
  padding: 4px 10px;
  border-radius: 8px;
}

.micro-badge svg {
  width: 14px;
  height: 14px;
  color: var(--ub-green);
}

/* =====================================================
   COLUMNA DERECHA: FORMULARIO DE LOGIN
   ===================================================== */
.login-form-col {
  background: var(--ub-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 4vw, 56px) clamp(24px, 3.5vw, 48px);
}

.login-card-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header del Formulario */
.form-header {
  text-align: left;
}

.form-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ub-primary);
  background: #EAF7F4;
  padding: 6px 14px;
  border-radius: 30px;
  margin-bottom: 12px;
}

.form-brand-badge svg {
  width: 16px;
  height: 16px;
}

.form-title {
  font-size: 28px;
  font-weight: 750;
  color: var(--ub-text);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.form-subtitle {
  font-size: 14.5px;
  color: var(--ub-muted);
  margin: 0;
}

/* Estilos de los inputs */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}

.input-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ub-text);
}

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

.input-field {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid #DDE8E6;
  border-radius: var(--ub-radius);
  background: #FFFFFF;
  color: var(--ub-text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.input-field:focus {
  border-color: var(--ub-border-focus);
  box-shadow: 0 0 0 3.5px rgba(0, 128, 128, 0.12);
}

.input-field::placeholder {
  color: #A2B5B4;
}

.input-wrapper.has-btn .input-field {
  padding-right: 48px;
}

.btn-toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--ub-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.btn-toggle-password:hover {
  color: var(--ub-primary);
  background-color: #F0F7F6;
}

.btn-toggle-password svg {
  width: 20px;
  height: 20px;
}

/* Opciones de login: remember & forgot pass */
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  flex-wrap: wrap;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--ub-text);
  font-weight: 500;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  accent-color: var(--ub-primary);
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.link-forgot {
  color: var(--ub-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease, text-decoration 0.2s ease;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: 13.5px;
  font-family: inherit;
}

.link-forgot:hover {
  color: var(--ub-primary-dark);
  text-decoration: underline;
}

/* Botón principal de login */
.btn-submit-login {
  width: 100%;
  height: 56px;
  background: var(--ub-primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--ub-radius);
  font-size: 17px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 128, 128, 0.2);
}

.btn-submit-login:hover {
  background: var(--ub-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 128, 128, 0.28);
}

.btn-submit-login:active {
  transform: translateY(0);
}

.btn-submit-login svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.btn-submit-login:hover svg {
  transform: translateX(3px);
}

/* Mensajes de error */
.msg {
  font-size: 13.5px;
  line-height: 1.4;
  border-radius: 10px;
  transition: all 0.2s ease;
  display: none;
}

.msg:not(:empty) {
  display: block;
  padding: 10px 14px;
}

.msg.err {
  background: #FEF3F2;
  border: 1px solid #FECDCA;
  color: var(--ub-error);
  font-weight: 500;
}

.msg.ok {
  background: #EDFDF5;
  border: 1px solid #A6F4C5;
  color: #027A48;
  font-weight: 500;
}

/* Separadores y acciones secundarias */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--ub-border);
}

.auth-divider span {
  font-size: 13px;
  color: var(--ub-muted);
  font-weight: 500;
}

/* Botón Crear Cuenta */
.btn-secondary-outline {
  width: 100%;
  height: 52px;
  background: transparent;
  border: 1.5px solid var(--ub-primary);
  color: #007575;
  border-radius: var(--ub-radius);
  font-size: 15.5px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}

.btn-secondary-outline:hover {
  background: #EAF7F4;
  color: var(--ub-primary-dark);
  border-color: var(--ub-primary-dark);
}

/* Bloque Probar Gratis */
.trial-cta-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  background: #F8FBFB;
  border: 1px dashed #C8E3DE;
  border-radius: var(--ub-radius);
  text-align: center;
}

.trial-cta-text {
  font-size: 13px;
  color: var(--ub-muted);
  margin: 0;
}

.btn-trial-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ub-primary);
  font-weight: 700;
  font-size: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
  font-family: inherit;
}

.btn-trial-link:hover {
  color: var(--ub-primary-dark);
  background-color: #EAF7F4;
}

.btn-trial-link svg {
  width: 15px;
  height: 15px;
}

/* Pie del formulario */
.form-footer-quote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: #728B8D;
  text-align: center;
  margin-top: 4px;
}

.form-footer-quote svg {
  width: 16px;
  height: 16px;
  color: var(--ub-green);
  flex-shrink: 0;
}

/* =====================================================
   RESPONSIVE & BREAKPOINTS
   ===================================================== */

/* Tablet (768px a 1099px) */
@media (max-width: 1099px) and (min-width: 768px) {
  .login-layout {
    grid-template-columns: 52% 48%;
  }

  .login-hero-col {
    padding: 36px 24px;
    gap: 24px;
  }

  .hero-headline {
    font-size: 34px;
  }

  .hero-benefits-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .benefit-item {
    padding: 12px 14px;
  }

  .hero-visual-card {
    grid-template-columns: 140px 1fr;
    padding: 12px;
    gap: 14px;
  }

  .hero-photo-wrapper {
    height: 110px;
  }

  .login-form-col {
    padding: 36px 24px;
  }
}

/* Móvil (< 768px) */
@media (max-width: 767px) {
  .login-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  /* Columna izquierda se convierte en encabezado inicial compacto */
  .login-hero-col {
    padding: 28px 20px 16px;
    border-right: none;
    border-bottom: 1px solid var(--ub-border);
    gap: 16px;
  }

  .hero-brand {
    justify-content: center;
    text-align: center;
  }

  .hero-headline {
    font-size: 26px;
    text-align: center;
  }

  .hero-desc {
    font-size: 14px;
    text-align: center;
  }

  /* Ocultar elementos pesados o secundarios en móvil */
  .hero-benefits-grid,
  .hero-visual-card,
  .hero-photo-wrapper {
    display: none !important;
  }

  /* Columna derecha formulario en móvil */
  .login-form-col {
    padding: 24px 20px 40px;
    align-items: flex-start;
  }

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

  .form-header {
    text-align: center;
  }

  .form-title {
    font-size: 24px;
  }

  .input-field {
    height: 50px;
    font-size: 16px !important;
  }

  .btn-submit-login {
    height: 52px;
  }

  /* Beneficios resumidos para móvil al final */
  .mobile-benefits-summary {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--ub-border);
  }

  .mobile-benefit-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #F4FAF8;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ub-petroleo);
  }

  .mobile-benefit-pill svg {
    width: 18px;
    height: 18px;
    color: var(--ub-primary);
  }
}

@media (min-width: 768px) {
  .mobile-benefits-summary {
    display: none !important;
  }
}

/* Respeto a accesibilidad y prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
