/* ==========================================================================
   KAMIONCLOUD AUTHENTICATION (LOGIN & REGISTRO) v2.0
   Identidad: Grafito + Verde Petróleo · Composición Dos Zonas (Escritorio)
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

body.auth-body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family, 'Inter', system-ui, sans-serif);
  background-color: var(--kc-bg, #F6F7F4);
  color: var(--kc-text, #202C2A);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Contenedor principal de pantalla completa */
.auth-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ==========================================================================
   ZONA 1: PANEL INSTITUCIONAL EN GRAFITO (ESCRITORIO >= 1024px)
   ========================================================================== */
.auth-hero {
  display: none;
}

@media (min-width: 1024px) {
  .auth-hero {
    display: flex;
    flex-direction: column;
    width: 44%;
    max-width: 540px;
    background-color: var(--kc-nav-bg, #202C2A);
    color: var(--kc-nav-text, #F0F4EF);
    padding: 56px 48px;
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--kc-border, #394B44);
  }

  /* Textura geométrica sutil editorial */
  .auth-hero::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle at 100% 0%, rgba(18, 107, 99, 0.22) 0%, transparent 70%);
    pointer-events: none;
  }

  .auth-hero__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    position: relative;
    z-index: 1;
  }

  .auth-hero__brand {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .auth-hero__logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
  }

  .auth-hero__name {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #FFFFFF;
  }

  .auth-hero__lead {
    margin: 40px 0 32px 0;
  }

  .auth-hero__title {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    margin: 0 0 14px 0;
  }

  .auth-hero__desc {
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(240, 244, 239, 0.75);
    margin: 0;
  }

  .auth-hero__features {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .auth-hero__feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
  }

  .auth-hero__feature svg,
  .auth-hero__feature i {
    width: 22px;
    height: 22px;
    stroke: var(--kc-primary, #74D4C0);
    flex-shrink: 0;
    margin-top: 2px;
  }

  .auth-hero__feature strong {
    display: block;
    font-size: 0.95rem;
    color: #FFFFFF;
    font-weight: 600;
    margin-bottom: 2px;
  }

  .auth-hero__feature span {
    display: block;
    font-size: 0.85rem;
    color: rgba(240, 244, 239, 0.68);
    line-height: 1.4;
  }

  .auth-hero__footer {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: rgba(240, 244, 239, 0.5);
  }
}

/* ==========================================================================
   ZONA 2: PANEL DE FORMULARIO OPERATIVO (RESPONSIVE)
   ========================================================================== */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background-color: var(--kc-bg, #F6F7F4);
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--kc-surface, #FFFFFF);
  border: 1px solid var(--kc-border, #DCE3DE);
  border-radius: var(--radius-card, 12px);
  padding: 36px 28px;
  box-shadow: var(--shadow-card, 0 4px 12px rgba(16, 24, 22, 0.06));
}

@media (max-width: 480px) {
  .auth-main {
    padding: 16px 12px;
    align-items: flex-start;
  }

  .auth-card {
    padding: 24px 18px;
    border-radius: 10px;
    border: 1px solid var(--kc-border, #DCE3DE);
    box-shadow: none;
  }
}

/* Encabezado del formulario */
.auth-header {
  margin-bottom: 24px;
}

.auth-header__brand-mobile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

@media (min-width: 1024px) {
  .auth-header__brand-mobile {
    display: none;
  }
}

.auth-header__logo-mobile {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.auth-header__name-mobile {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--kc-text, #202C2A);
}

.auth-header__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  background-color: var(--kc-primary-soft, #DDECE7);
  color: var(--kc-primary, #126B63);
  border-radius: var(--radius-chip, 6px);
  margin-bottom: 10px;
}

[data-theme="dark"] .auth-header__badge,
[data-theme="oscuro"] .auth-header__badge {
  color: var(--kc-primary, #74D4C0);
  background-color: var(--kc-primary-soft, #1F443B);
}

.auth-header__title {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--kc-text, #202C2A);
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.auth-header__subtitle {
  font-size: 0.925rem;
  line-height: 1.5;
  color: var(--kc-text-muted, #53615D);
  margin: 0;
}

/* Botón Volver (para registro) */
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0 0 16px 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--kc-text-muted, #53615D);
  cursor: pointer;
  transition: color var(--transition-fast, 150ms ease);
}

.auth-back:hover {
  color: var(--kc-primary, #126B63);
}

.auth-back svg,
.auth-back i {
  width: 16px;
  height: 16px;
}

/* Formulario y campos */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--kc-text, #202C2A);
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--kc-text-muted, #53615D);
  pointer-events: none;
}

.auth-input {
  width: 100%;
  height: 48px;
  padding: 10px 14px 10px 42px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--kc-text, #202C2A);
  background-color: var(--kc-surface, #FFFFFF);
  border: 1px solid var(--kc-border, #DCE3DE);
  border-radius: var(--radius-control, 8px);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.auth-input:focus {
  border-color: var(--kc-primary, #126B63);
  box-shadow: 0 0 0 3px var(--kc-primary-soft, #DDECE7);
}

[data-theme="dark"] .auth-input:focus,
[data-theme="oscuro"] .auth-input:focus {
  border-color: var(--kc-primary, #74D4C0);
  box-shadow: 0 0 0 3px var(--kc-primary-soft, #1F443B);
}

.auth-input::placeholder {
  color: var(--kc-text-muted, #53615D);
  opacity: 0.65;
}

/* Botón Principal de Acción */
.auth-btn {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--kc-primary, #126B63);
  color: var(--kc-on-primary, #FFFFFF);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-control, 8px);
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.auth-btn:hover:not(:disabled) {
  background-color: var(--kc-primary-hover, #0C5751);
}

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

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

.auth-btn svg,
.auth-btn i {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

/* Mensajes de error / éxito accesibles */
.mensaje {
  margin: 0 0 16px 0;
  padding: 12px 14px;
  border-radius: var(--radius-control, 8px);
  font-size: 0.875rem;
  line-height: 1.45;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mensaje.error {
  background-color: rgba(181, 62, 64, 0.1);
  color: var(--kc-danger, #B53E40);
  border: 1px solid var(--kc-danger, #B53E40);
}

.mensaje.exito {
  background-color: rgba(33, 114, 76, 0.1);
  color: var(--kc-success, #21724C);
  border: 1px solid var(--kc-success, #21724C);
}

/* Pie del formulario / enlaces secundarios */
.auth-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--kc-border, #DCE3DE);
  text-align: center;
}

.auth-footer__switch {
  margin: 0 0 10px 0;
  font-size: 0.925rem;
  color: var(--kc-text-muted, #53615D);
}

.auth-link {
  color: var(--kc-primary, #126B63);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}

[data-theme="dark"] .auth-link,
[data-theme="oscuro"] .auth-link {
  color: var(--kc-primary, #74D4C0);
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-footer__terms {
  margin: 0;
  font-size: 0.8rem;
  color: var(--kc-text-muted, #53615D);
  line-height: 1.4;
}

.auth-sublink {
  color: var(--kc-text-muted, #53615D);
  text-decoration: underline;
}

.auth-sublink:hover {
  color: var(--kc-text, #202C2A);
}
