/* ===================================
   RESET
=================================== */

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

:root {
  --primary: #f59e0b;
  --primary-dark: #f97316;

  --dark: #111827;
  --dark-blue: #14213d;

  --text: #334155;
  --muted: #64748b;

  --border: #e2e8f0;

  --background: #f8fafc;
  --white: #ffffff;

  --danger: #dc2626;
  --success: #16a34a;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;

  font-family: "Poppins", sans-serif;

  color: var(--text);

  background:
    radial-gradient(
      circle at top left,
      rgba(245, 158, 11, 0.04),
      transparent 28%
    ),
    #f8fafc;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
}

/* ===================================
   PÁGINA
=================================== */

.auth-page {
  width: 100%;
  min-height: 100vh;

  padding: 30px;

  display: flex;

  align-items: center;

  justify-content: center;
}

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

.auth-shell {
  width: 100%;
  max-width: 1180px;

  min-height: 700px;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1.08fr);

  overflow: hidden;

  border: 1px solid var(--border);

  border-radius: 28px;

  background: var(--white);

  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.12);
}

/* ===================================
   PANEL IZQUIERDO
=================================== */

.auth-visual {
  position: relative;

  min-width: 0;

  padding: 38px 42px;

  display: flex;

  flex-direction: column;

  overflow: hidden;

  color: white;

  background: linear-gradient(145deg, #111827 0%, #172033 55%, #1e293b 100%);
}

/* DECORACIÓN */

.auth-visual::before {
  content: "";

  position: absolute;

  top: -170px;
  right: -210px;

  width: 500px;
  height: 500px;

  border-radius: 50%;

  background: repeating-linear-gradient(
    -45deg,
    rgba(245, 158, 11, 0.15) 0,
    rgba(245, 158, 11, 0.15) 3px,
    transparent 3px,
    transparent 18px
  );
}

.auth-visual::after {
  content: "";

  position: absolute;

  bottom: -170px;
  left: -170px;

  width: 330px;
  height: 330px;

  border-radius: 50%;

  background: repeating-linear-gradient(
    45deg,
    rgba(249, 115, 22, 0.09) 0,
    rgba(249, 115, 22, 0.09) 3px,
    transparent 3px,
    transparent 17px
  );
}

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

.auth-logo {
  position: relative;

  z-index: 3;

  display: inline-flex;

  align-items: center;

  align-self: flex-start;

  gap: 11px;

  color: white;

  font-size: 20px;

  font-weight: 800;

  letter-spacing: -0.5px;
}

.auth-logo-icon {
  width: 41px;
  height: 41px;

  flex-shrink: 0;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 12px;

  color: white;

  background: linear-gradient(135deg, var(--primary), var(--primary-dark));

  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.25);
}

/* ===================================
   TEXTO IZQUIERDO
=================================== */

.auth-visual-content {
  position: relative;

  z-index: 3;

  width: 100%;
  max-width: 470px;

  margin: auto 0;
}

.auth-badge {
  display: inline-flex;

  align-items: center;

  gap: 8px;

  margin-bottom: 20px;

  padding: 7px 12px;

  border: 1px solid rgba(245, 158, 11, 0.28);

  border-radius: 999px;

  background: rgba(245, 158, 11, 0.1);

  color: #fbbf24;

  font-size: 11px;

  font-weight: 700;
}

.auth-visual-content h1 {
  max-width: 500px;

  margin-bottom: 18px;

  color: white;

  font-size: clamp(40px, 4vw, 58px);

  line-height: 1.04;

  letter-spacing: -2px;

  font-weight: 800;
}

.auth-visual-content > p {
  max-width: 440px;

  margin-bottom: 30px;

  color: #cbd5e1;

  font-size: 14px;

  line-height: 1.7;
}

/* ===================================
   FEATURES
=================================== */

.auth-features {
  display: flex;

  flex-direction: column;

  gap: 12px;
}

.auth-feature {
  display: flex;

  align-items: center;

  gap: 12px;

  color: #e2e8f0;

  font-size: 13px;

  font-weight: 600;
}

.auth-feature i {
  width: 36px;
  height: 36px;

  flex-shrink: 0;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 10px;

  background: rgba(255, 255, 255, 0.07);

  color: #fbbf24;
}

/* ===================================
   ICONOS FLOTANTES
=================================== */

.auth-floating {
  position: absolute;

  z-index: 2;

  width: 58px;
  height: 58px;

  display: flex;

  align-items: center;

  justify-content: center;

  border: 1px solid rgba(255, 255, 255, 0.1);

  border-radius: 17px;

  background: rgba(255, 255, 255, 0.06);

  color: #fbbf24;

  font-size: 20px;

  backdrop-filter: blur(8px);

  animation: authFloat 4s ease-in-out infinite;
}

.icon-one {
  top: 115px;
  right: 55px;
}

.icon-two {
  right: 105px;
  bottom: 65px;

  animation-delay: 0.8s;
}

.icon-three {
  right: 28px;
  bottom: 180px;

  animation-delay: 1.5s;
}

@keyframes authFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* ===================================
   LADO DERECHO
=================================== */

.auth-form-side {
  min-width: 0;

  padding: 48px 54px;

  display: flex;

  align-items: center;

  justify-content: center;

  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

/* ===================================
   FORM WRAPPER
=================================== */

.auth-form-wrapper {
  width: 100%;
  max-width: 445px;
}

.register-wrapper {
  width: 100%;
  max-width: 540px;
}

/* ===================================
   CABECERA FORM
=================================== */

.auth-heading {
  margin-bottom: 28px;
}

.auth-small-title {
  display: block;

  margin-bottom: 7px;

  color: #d97706;

  font-size: 11px;

  font-weight: 800;

  text-transform: uppercase;

  letter-spacing: 1px;
}

.auth-heading h2 {
  margin-bottom: 8px;

  color: var(--dark-blue);

  font-size: 34px;

  line-height: 1.15;

  font-weight: 800;

  letter-spacing: -1px;
}

.auth-heading p {
  color: var(--muted);

  font-size: 13px;

  line-height: 1.6;
}

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

.auth-form {
  width: 100%;
}

.form-group {
  width: 100%;

  min-width: 0;

  margin-bottom: 16px;
}

.form-group label {
  display: block;

  margin-bottom: 7px;

  color: #1e293b;

  font-size: 12px;

  font-weight: 700;
}

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

.form-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 16px;
}

/* ===================================
   REGISTER
=================================== */

/*
  Primer grid:

  Nombre     Apellido
  Teléfono en toda la fila

  Funciona aunque Teléfono esté
  dentro del primer .form-grid.
*/

.register-form .form-grid:first-of-type .form-group:nth-child(3) {
  grid-column: 1 / -1;
}

/* ===================================
   INPUT GROUP
=================================== */

.input-group {
  position: relative;

  width: 100%;
  min-width: 0;

  display: flex;

  align-items: center;
}

.input-group > i {
  position: absolute;

  left: 15px;

  z-index: 2;

  color: #94a3b8;

  font-size: 13px;

  pointer-events: none;
}

.input-group input {
  width: 100%;
  min-width: 0;

  height: 49px;

  padding: 0 15px 0 44px;

  border: 1px solid var(--border);

  border-radius: 11px;

  outline: none;

  background: white;

  color: #1e293b;

  font-size: 13px;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.input-group input::placeholder {
  color: #a8b2c1;
}

.input-group input:hover {
  border-color: #cbd5e1;
}

.input-group input:focus {
  border-color: var(--primary);

  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

/* ===================================
   AUTOFILL
=================================== */

.input-group input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px white inset;

  -webkit-text-fill-color: #1e293b;
}

/* ===================================
   LABEL ROW
=================================== */

.label-row {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 15px;
}

.label-row label {
  margin-bottom: 7px;
}

.forgot-password {
  margin-bottom: 7px;

  color: #d97706;

  font-size: 11px;

  font-weight: 700;
}

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

/* ===================================
   BOTÓN VER CONTRASEÑA
=================================== */

.password-button {
  position: absolute;

  right: 9px;

  z-index: 3;

  width: 34px;
  height: 34px;

  display: flex;

  align-items: center;

  justify-content: center;

  border: none;

  border-radius: 8px;

  background: transparent;

  color: #94a3b8;

  cursor: pointer;
}

.password-button:hover {
  background: #f8fafc;

  color: #64748b;
}

.input-group:has(.password-button) input {
  padding-right: 48px;
}

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

.remember-row,
.terms-row {
  display: flex;

  align-items: flex-start;

  gap: 9px;

  margin: 3px 0 18px;

  color: #64748b;

  font-size: 11.5px;

  line-height: 1.5;
}

.remember-row input,
.terms-row input {
  width: 15px;
  height: 15px;

  margin-top: 1px;

  flex-shrink: 0;

  accent-color: var(--primary);
}

.terms-row a {
  color: #d97706;

  font-weight: 700;
}

.terms-row a:hover {
  color: var(--primary-dark);
}

/* ===================================
   MENSAJES
=================================== */

.auth-message {
  display: none;

  margin-bottom: 14px;

  padding: 11px 13px;

  border-radius: 10px;

  font-size: 11px;

  font-weight: 500;

  line-height: 1.5;
}

.auth-message:not(:empty) {
  display: block;
}

.auth-message.error {
  border: 1px solid #fecaca;

  background: #fff1f2;

  color: var(--danger);
}

.auth-message.success {
  border: 1px solid #bbf7d0;

  background: #f0fdf4;

  color: #15803d;
}

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

.btn-auth {
  width: 100%;
  height: 50px;

  display: flex;

  align-items: center;

  justify-content: center;

  gap: 10px;

  border: none;

  border-radius: 11px;

  background: linear-gradient(135deg, var(--primary), var(--primary-dark));

  color: white;

  font-size: 13px;

  font-weight: 700;

  cursor: pointer;

  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.22);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.btn-auth:hover {
  transform: translateY(-2px);

  box-shadow: 0 14px 30px rgba(245, 158, 11, 0.3);
}

.btn-auth:disabled {
  opacity: 0.65;

  cursor: wait;

  transform: none;
}

/* ===================================
   DIVISOR
=================================== */

.auth-divider {
  position: relative;

  margin: 20px 0;

  text-align: center;
}

.auth-divider::before {
  content: "";

  position: absolute;

  top: 50%;
  left: 0;

  width: 100%;
  height: 1px;

  background: #edf1f5;
}

.auth-divider span {
  position: relative;

  padding: 0 12px;

  background: white;

  color: #94a3b8;

  font-size: 11px;
}

/* ===================================
   PARTE INFERIOR
=================================== */

.auth-switch {
  margin-top: 18px;

  text-align: center;

  color: #64748b;

  font-size: 12px;
}

.auth-switch a {
  margin-left: 4px;

  color: #d97706;

  font-weight: 700;
}

.auth-switch a:hover {
  color: var(--primary-dark);
}

.back-home {
  margin-top: 16px;

  display: flex;

  align-items: center;

  justify-content: center;

  gap: 8px;

  color: #94a3b8;

  font-size: 11px;

  transition: color 0.2s ease;
}

.back-home:hover {
  color: #d97706;
}

/* ===================================
   REGISTER INFERIOR
=================================== */

.register-wrapper .btn-auth {
  margin-top: 2px;
}

.register-wrapper .auth-switch {
  margin-top: 17px;
}

.register-wrapper .back-home {
  margin-top: 14px;
}

/* ===================================
   LAPTOP
=================================== */

@media (max-width: 1100px) {
  .auth-page {
    padding: 20px;
  }

  .auth-shell {
    grid-template-columns:
      0.9fr
      1.1fr;
  }

  .auth-visual {
    padding: 34px;
  }

  .auth-form-side {
    padding: 42px 38px;
  }

  .auth-visual-content h1 {
    font-size: 46px;
  }
}

/* ===================================
   TABLET
=================================== */

@media (max-width: 900px) {
  .auth-page {
    padding: 0;
  }

  .auth-shell {
    max-width: none;

    min-height: 100vh;

    grid-template-columns: 1fr;

    border: none;

    border-radius: 0;

    box-shadow: none;
  }

  .auth-visual {
    min-height: 320px;

    padding: 30px 28px;
  }

  .auth-visual-content {
    margin: 50px 0 10px;
  }

  .auth-visual-content h1 {
    max-width: 600px;

    font-size: 42px;
  }

  .auth-visual-content > p {
    margin-bottom: 0;
  }

  .auth-features {
    display: none;
  }

  .auth-form-side {
    padding: 48px 24px 55px;
  }

  .auth-form-wrapper,
  .register-wrapper {
    max-width: 600px;
  }
}

/* ===================================
   CELULAR
=================================== */

@media (max-width: 600px) {
  .auth-visual {
    min-height: 275px;

    padding: 24px 20px;
  }

  .auth-logo {
    font-size: 18px;
  }

  .auth-logo-icon {
    width: 37px;
    height: 37px;

    border-radius: 11px;
  }

  .auth-visual-content {
    margin-top: 38px;
  }

  .auth-badge {
    margin-bottom: 13px;

    font-size: 10px;
  }

  .auth-visual-content h1 {
    font-size: 33px;

    letter-spacing: -1.3px;
  }

  .auth-visual-content > p {
    font-size: 13px;
  }

  .auth-floating {
    display: none;
  }

  .auth-form-side {
    padding: 35px 18px 45px;
  }

  .auth-heading {
    margin-bottom: 23px;
  }

  .auth-heading h2 {
    font-size: 28px;
  }

  /* TODOS LOS GRIDS A UNA COLUMNA */

  .form-grid {
    grid-template-columns: 1fr;

    gap: 0;
  }

  .register-form .form-grid:first-of-type .form-group:nth-child(3) {
    grid-column: auto;
  }

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

  .input-group input {
    height: 48px;
  }

  .label-row {
    align-items: flex-start;

    flex-direction: column;

    gap: 0;
  }
}

/* ===================================
   CELULAR PEQUEÑO
=================================== */

@media (max-width: 390px) {
  .auth-visual {
    padding: 22px 16px;
  }

  .auth-form-side {
    padding: 30px 15px 40px;
  }

  .auth-visual-content h1 {
    font-size: 29px;
  }

  .auth-heading h2 {
    font-size: 26px;
  }
}

/* ===================================
   ALTURA BAJA EN PC
=================================== */

@media (max-height: 760px) and (min-width: 901px) {
  .auth-page {
    align-items: flex-start;
  }

  .auth-shell {
    min-height: 660px;
  }

  .auth-visual {
    padding: 30px 36px;
  }

  .auth-form-side {
    padding: 30px 45px;
  }

  .auth-heading {
    margin-bottom: 20px;
  }

  .auth-heading h2 {
    font-size: 30px;
  }

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

  .input-group input {
    height: 45px;
  }

  .btn-auth {
    height: 47px;
  }
}

/* ===================================
   ACCESIBILIDAD
=================================== */

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(245, 158, 11, 0.25);

  outline-offset: 3px;
}

/* ===================================
   REDUCIR MOVIMIENTO
=================================== */

@media (prefers-reduced-motion: reduce) {
  .auth-floating {
    animation: none;
  }

  * {
    scroll-behavior: auto !important;
  }
}
