/* =========================================================
   ML RENTABILIDAD · LOGIN
   frontend/login.css
   ========================================================= */

.login-view {
  position: fixed;
  inset: 0;
  z-index: 9999;

  min-height: 100dvh;

  display: flex;
  align-items: stretch;
  justify-content: stretch;

  overflow: hidden;

  background: #08090b;
  color: #f7f8fa;

  font-family:
    "DM Sans",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}


.login-view.hidden {
  display: none !important;
}


/* =========================================================
   BACKGROUND
   ========================================================= */

.login-background {
  position: absolute;
  inset: 0;

  overflow: hidden;

  pointer-events: none;
}


.login-background::before {
  content: "";

  position: absolute;
  inset: 0;

  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(255, 214, 10, 0.08),
      transparent 32%
    ),
    radial-gradient(
      circle at 80% 72%,
      rgba(255, 255, 255, 0.05),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      #08090b 0%,
      #0b0d10 45%,
      #08090b 100%
    );
}


.login-grid {
  position: absolute;
  inset: 0;

  opacity: 0.3;

  background-image:
    linear-gradient(
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px
    );

  background-size:
    54px 54px;

  mask-image:
    linear-gradient(
      to bottom,
      rgba(0,0,0,0.8),
      transparent 92%
    );

  animation:
    loginGridMove
    18s
    linear
    infinite;
}


.login-orb {
  position: absolute;

  width: 420px;
  height: 420px;

  border-radius: 999px;

  filter: blur(110px);

  opacity: 0.18;

  animation:
    loginOrbFloat
    12s
    ease-in-out
    infinite;
}


.login-orb-a {
  top: -160px;
  left: -120px;

  background: #ffd60a;
}


.login-orb-b {
  right: 8%;
  bottom: -180px;

  background: #ffffff;

  opacity: 0.07;

  animation-delay: -4s;
}


.login-orb-c {
  top: 42%;
  left: 46%;

  width: 280px;
  height: 280px;

  background: #ffd60a;

  opacity: 0.05;

  animation-delay: -8s;
}


/* =========================================================
   LAYOUT
   ========================================================= */

.login-layout {
  position: relative;
  z-index: 2;

  width: 100%;
  min-height: 100dvh;

  display: grid;

  grid-template-columns:
    minmax(0, 1.08fr)
    minmax(420px, 0.92fr);
}


/* =========================================================
   LEFT PRESENTATION
   ========================================================= */

.login-presentation {
  position: relative;

  min-height: 100dvh;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  padding:
    clamp(34px, 5vw, 72px);

  border-right:
    1px solid
    rgba(255, 255, 255, 0.07);

  animation:
    loginLeftEnter
    700ms
    cubic-bezier(.22,.8,.22,1)
    both;
}


.login-presentation::after {
  content: "";

  position: absolute;

  right: -1px;
  top: 10%;
  bottom: 10%;

  width: 1px;

  background:
    linear-gradient(
      to bottom,
      transparent,
      rgba(255, 214, 10, 0.28),
      transparent
    );
}


.login-presentation-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}


.login-logo {
  display: inline-flex;
  align-items: center;

  gap: 13px;
}


.login-logo-icon {
  width: 46px;
  height: 46px;

  display: grid;
  place-items: center;

  border:
    1px solid
    rgba(255, 214, 10, 0.22);

  border-radius: 13px;

  background:
    rgba(255, 214, 10, 0.08);

  color: #ffd60a;

  box-shadow:
    inset
    0
    1px
    0
    rgba(255,255,255,0.05);
}


.login-logo-icon svg {
  width: 21px;
  height: 21px;
}


.login-logo-icon-small {
  width: 40px;
  height: 40px;

  border-radius: 11px;
}


.login-logo-copy {
  display: flex;
  flex-direction: column;

  gap: 2px;
}


.login-logo-copy strong {
  color: #ffffff;

  font-size: 15px;
  font-weight: 750;

  letter-spacing:
    -0.025em;
}


.login-logo-copy span {
  color: #858b96;

  font-size: 11px;
  font-weight: 650;

  letter-spacing:
    0.04em;
}


/* =========================================================
   PRESENTATION CONTENT
   ========================================================= */

.login-presentation-content {
  width: min(100%, 680px);

  padding:
    50px
    0;

  animation:
    loginContentEnter
    850ms
    100ms
    cubic-bezier(.22,.8,.22,1)
    both;
}


.login-label {
  width: fit-content;

  min-height: 31px;

  display: inline-flex;
  align-items: center;

  gap: 8px;

  padding:
    0
    12px;

  margin-bottom: 24px;

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

  border-radius: 999px;

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

  color: #b9bec7;

  font-size: 10px;
  font-weight: 750;

  letter-spacing:
    0.08em;

  text-transform: uppercase;

  backdrop-filter:
    blur(12px);
}


.login-label-dot {
  width: 6px;
  height: 6px;

  border-radius: 999px;

  background: #ffd60a;

  box-shadow:
    0
    0
    0
    4px
    rgba(255, 214, 10, 0.08);

  animation:
    loginPulse
    2.2s
    ease-in-out
    infinite;
}


.login-presentation-content h1 {
  margin: 0;

  max-width: 780px;

  color: #ffffff;

  font-size:
    clamp(
      48px,
      6vw,
      88px
    );

  line-height: 0.98;

  font-weight: 780;

  letter-spacing:
    -0.065em;
}


.login-presentation-content h1 span {
  display: block;

  margin-top: 9px;

  color: #ffd60a;
}


.login-presentation-content > p {
  max-width: 600px;

  margin:
    28px
    0
    0;

  color: #999faa;

  font-size:
    clamp(
      15px,
      1.25vw,
      18px
    );

  line-height: 1.7;

  font-weight: 500;
}


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

.login-features {
  width: min(100%, 650px);

  display: grid;

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

  gap: 10px;

  margin-top: 40px;
}


.login-feature {
  min-width: 0;

  min-height: 96px;

  display: flex;
  align-items: flex-start;

  gap: 12px;

  padding: 16px;

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

  border-radius: 14px;

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

  backdrop-filter:
    blur(10px);

  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}


.login-feature:hover {
  transform:
    translateY(-3px);

  border-color:
    rgba(255, 214, 10, 0.16);

  background:
    rgba(255,255,255,0.045);
}


.login-feature-icon {
  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  flex: 0 0 auto;

  border-radius: 10px;

  background:
    rgba(255, 214, 10, 0.08);

  color: #ffd60a;
}


.login-feature-icon svg {
  width: 15px;
  height: 15px;
}


.login-feature > div {
  min-width: 0;

  display: flex;
  flex-direction: column;

  gap: 4px;
}


.login-feature strong {
  color: #f3f4f6;

  font-size: 12px;
  font-weight: 750;
}


.login-feature small {
  color: #777e89;

  font-size: 10px;
  line-height: 1.45;

  font-weight: 550;
}


/* =========================================================
   PRESENTATION FOOTER
   ========================================================= */

.login-presentation-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 18px;

  color: #646a74;

  font-size: 10px;
  font-weight: 650;

  letter-spacing:
    0.03em;
}


.login-system-status {
  display: inline-flex;
  align-items: center;

  gap: 8px;
}


.login-system-dot {
  width: 7px;
  height: 7px;

  border-radius: 999px;

  background: #66d17a;

  box-shadow:
    0
    0
    0
    4px
    rgba(102, 209, 122, 0.08);
}


/* =========================================================
   RIGHT ACCESS
   ========================================================= */

.login-access {
  min-height: 100dvh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding:
    clamp(24px, 5vw, 70px);

  background:
    rgba(5, 6, 8, 0.24);

  backdrop-filter:
    blur(4px);

  animation:
    loginRightEnter
    720ms
    80ms
    cubic-bezier(.22,.8,.22,1)
    both;
}


.login-access-inner {
  width:
    min(
      100%,
      470px
    );
}


.login-mobile-brand {
  display: none;
}


/* =========================================================
   CARD
   ========================================================= */

.login-card {
  position: relative;

  width: 100%;

  padding:
    clamp(26px, 4vw, 38px);

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

  border-radius: 20px;

  background:
    rgba(16, 18, 22, 0.88);

  box-shadow:
    0
    30px
    90px
    rgba(0,0,0,0.38),
    inset
    0
    1px
    0
    rgba(255,255,255,0.04);

  backdrop-filter:
    blur(28px);

  overflow: hidden;
}


.login-card::before {
  content: "";

  position: absolute;

  top: 0;
  left: 15%;
  right: 15%;

  height: 1px;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(255,214,10,0.5),
      transparent
    );
}


.login-card-header {
  margin-bottom: 30px;
}


.login-card-badge {
  width: fit-content;

  min-height: 30px;

  display: inline-flex;
  align-items: center;

  gap: 7px;

  padding:
    0
    11px;

  margin-bottom: 18px;

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

  border-radius: 999px;

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

  color: #a8aeb8;

  font-size: 10px;
  font-weight: 700;
}


.login-card-badge svg {
  width: 13px;
  height: 13px;

  color: #ffd60a;
}


.login-card-header h2 {
  margin: 0;

  color: #ffffff;

  font-size:
    clamp(
      28px,
      3vw,
      36px
    );

  font-weight: 760;

  letter-spacing:
    -0.045em;
}


.login-card-header p {
  margin:
    9px
    0
    0;

  color: #858b96;

  font-size: 13px;
  line-height: 1.55;

  font-weight: 500;
}


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

.login-form {
  display: grid;

  gap: 18px;
}


.login-field {
  display: grid;

  gap: 8px;
}


.login-field-label {
  color: #c9cdd4;

  font-size: 11px;
  font-weight: 700;

  letter-spacing:
    0.02em;
}


.login-input-shell {
  position: relative;

  min-height: 52px;

  display: flex;
  align-items: center;

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

  border-radius: 13px;

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

  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}


.login-input-shell:focus-within {
  border-color:
    rgba(255,214,10,0.46);

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

  box-shadow:
    0
    0
    0
    4px
    rgba(255,214,10,0.055);

  transform:
    translateY(-1px);
}


.login-input-icon {
  width: 50px;
  height: 50px;

  display: grid;
  place-items: center;

  flex: 0 0 auto;

  color: #737984;
}


.login-input-icon svg {
  width: 17px;
  height: 17px;
}


.login-input-shell:focus-within
.login-input-icon {
  color: #ffd60a;
}


.login-input-shell input {
  width: 100%;
  min-width: 0;

  height: 50px;

  padding:
    0
    14px
    0
    0;

  border: 0;
  outline: 0;

  background: transparent;

  color: #ffffff;

  font: inherit;
  font-size: 13px;
  font-weight: 600;

  caret-color: #ffd60a;
}


.login-input-shell input::placeholder {
  color: #565c66;

  font-weight: 500;
}


.login-password-toggle {
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  flex: 0 0 auto;

  margin-right: 5px;

  border: 0;
  border-radius: 10px;

  background: transparent;

  color: #69707a;

  cursor: pointer;

  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}


.login-password-toggle:hover {
  background:
    rgba(255,255,255,0.05);

  color: #ffffff;

  transform:
    scale(1.03);
}


.login-password-toggle svg {
  width: 16px;
  height: 16px;
}


/* =========================================================
   MESSAGE
   ========================================================= */

.login-message {
  min-height: 18px;

  margin-top: -2px;

  color: #ff7777;

  font-size: 11px;
  line-height: 1.45;

  font-weight: 650;
}


/* =========================================================
   SUBMIT
   ========================================================= */

.login-submit {
  position: relative;

  width: 100%;
  min-height: 52px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-top: 2px;

  padding:
    0
    8px
    0
    19px;

  border:
    1px solid
    rgba(255,214,10,0.42);

  border-radius: 13px;

  background: #ffd60a;

  color: #111214;

  font: inherit;
  font-size: 12px;
  font-weight: 800;

  cursor: pointer;

  overflow: hidden;

  box-shadow:
    0
    10px
    30px
    rgba(255,214,10,0.1);

  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}


.login-submit::before {
  content: "";

  position: absolute;

  top: -100%;
  left: -45%;

  width: 40%;
  height: 300%;

  transform:
    rotate(24deg);

  background:
    linear-gradient(
      to right,
      transparent,
      rgba(255,255,255,0.5),
      transparent
    );

  transition:
    left
    600ms
    ease;
}


.login-submit:hover {
  transform:
    translateY(-2px);

  box-shadow:
    0
    16px
    42px
    rgba(255,214,10,0.16);

  filter:
    brightness(1.03);
}


.login-submit:hover::before {
  left: 120%;
}


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


.login-submit:disabled {
  opacity: 0.55;

  cursor: wait;

  transform: none;
}


.login-submit-icon {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border-radius: 10px;

  background:
    rgba(0,0,0,0.09);

  transition:
    transform 180ms ease;
}


.login-submit:hover
.login-submit-icon {
  transform:
    translateX(2px);
}


.login-submit-icon svg {
  width: 16px;
  height: 16px;
}


/* =========================================================
   CARD FOOTER
   ========================================================= */

.login-card-footer {
  display: flex;
  align-items: center;

  gap: 9px;

  margin-top: 22px;

  padding-top: 20px;

  border-top:
    1px solid
    rgba(255,255,255,0.06);
}


.login-card-footer > span {
  width: 27px;
  height: 27px;

  display: grid;
  place-items: center;

  flex: 0 0 auto;

  border-radius: 8px;

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

  color: #686f79;
}


.login-card-footer svg {
  width: 12px;
  height: 12px;
}


.login-card-footer p {
  margin: 0;

  color: #656c76;

  font-size: 9px;
  line-height: 1.5;

  font-weight: 550;
}


/* =========================================================
   RIGHT FOOTER
   ========================================================= */

.login-access-footer {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 8px;

  margin-top: 18px;

  color: #555b64;

  font-size: 9px;
  font-weight: 650;
}


.login-access-footer-dot {
  width: 3px;
  height: 3px;

  border-radius: 999px;

  background: #555b64;
}


/* =========================================================
   LIGHT MODE
   ========================================================= */

html[data-theme="light"]
.login-view {
  background: #f4f5f7;
  color: #101216;
}


html[data-theme="light"]
.login-background::before {
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(228, 190, 0, 0.09),
      transparent 32%
    ),
    radial-gradient(
      circle at 75% 70%,
      rgba(0,0,0,0.035),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      #f7f8fa 0%,
      #f0f2f5 100%
    );
}


html[data-theme="light"]
.login-grid {
  opacity: 0.25;

  background-image:
    linear-gradient(
      rgba(0,0,0,0.035) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(0,0,0,0.035) 1px,
      transparent 1px
    );
}


html[data-theme="light"]
.login-presentation {
  border-right-color:
    rgba(0,0,0,0.08);
}


html[data-theme="light"]
.login-logo-copy strong,
html[data-theme="light"]
.login-presentation-content h1,
html[data-theme="light"]
.login-card-header h2,
html[data-theme="light"]
.login-input-shell input {
  color: #111318;
}


html[data-theme="light"]
.login-logo-copy span,
html[data-theme="light"]
.login-presentation-content > p,
html[data-theme="light"]
.login-card-header p {
  color: #646b75;
}


html[data-theme="light"]
.login-label {
  border-color:
    rgba(0,0,0,0.08);

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

  color: #606772;
}


html[data-theme="light"]
.login-feature {
  border-color:
    rgba(0,0,0,0.07);

  background:
    rgba(255,255,255,0.55);
}


html[data-theme="light"]
.login-feature:hover {
  border-color:
    rgba(190,155,0,0.22);

  background:
    rgba(255,255,255,0.8);
}


html[data-theme="light"]
.login-feature strong {
  color: #191c21;
}


html[data-theme="light"]
.login-feature small {
  color: #6a717b;
}


html[data-theme="light"]
.login-access {
  background:
    rgba(255,255,255,0.22);
}


html[data-theme="light"]
.login-card {
  border-color:
    rgba(0,0,0,0.08);

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

  box-shadow:
    0
    30px
    90px
    rgba(20,25,32,0.09),
    inset
    0
    1px
    0
    rgba(255,255,255,0.7);
}


html[data-theme="light"]
.login-card-badge {
  border-color:
    rgba(0,0,0,0.07);

  background:
    rgba(0,0,0,0.025);

  color: #606771;
}


html[data-theme="light"]
.login-field-label {
  color: #31363d;
}


html[data-theme="light"]
.login-input-shell {
  border-color:
    rgba(0,0,0,0.1);

  background:
    rgba(0,0,0,0.025);
}


html[data-theme="light"]
.login-input-shell:focus-within {
  border-color:
    rgba(195,160,0,0.48);

  background:
    rgba(255,255,255,0.9);
}


html[data-theme="light"]
.login-input-shell input::placeholder {
  color: #969ca4;
}


html[data-theme="light"]
.login-password-toggle:hover {
  background:
    rgba(0,0,0,0.05);

  color: #111318;
}


html[data-theme="light"]
.login-card-footer {
  border-top-color:
    rgba(0,0,0,0.06);
}


html[data-theme="light"]
.login-card-footer p,
html[data-theme="light"]
.login-access-footer,
html[data-theme="light"]
.login-presentation-footer {
  color: #777e87;
}


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

@media (
  max-width: 1100px
) {

  .login-layout {
    grid-template-columns:
      minmax(0, 0.9fr)
      minmax(390px, 1.1fr);
  }


  .login-presentation {
    padding:
      38px;
  }


  .login-presentation-content h1 {
    font-size:
      clamp(
        44px,
        6vw,
        68px
      );
  }


  .login-features {
    grid-template-columns: 1fr;
  }


  .login-feature {
    min-height: 70px;
  }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (
  max-width: 820px
) {

  .login-view {
    position: fixed;

    overflow-y: auto;
  }


  .login-layout {
    min-height: 100dvh;

    display: block;
  }


  .login-presentation {
    display: none;
  }


  .login-access {
    min-height: 100dvh;

    padding:
      20px;
  }


  .login-access-inner {
    width: min(100%, 460px);
  }


  .login-mobile-brand {
    display: flex;
    align-items: center;

    gap: 11px;

    margin-bottom: 24px;

    animation:
      loginMobileBrandEnter
      650ms
      ease
      both;
  }


  .login-mobile-brand > div:last-child {
    display: flex;
    flex-direction: column;

    gap: 2px;
  }


  .login-mobile-brand strong {
    color: #ffffff;

    font-size: 14px;
    font-weight: 750;
  }


  .login-mobile-brand span {
    color: #777e88;

    font-size: 10px;
    font-weight: 600;
  }


  html[data-theme="light"]
  .login-mobile-brand strong {
    color: #111318;
  }


  .login-card {
    border-radius: 18px;

    padding: 26px;
  }


  .login-card-header {
    margin-bottom: 26px;
  }


  .login-card-header h2 {
    font-size: 30px;
  }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (
  max-width: 520px
) {

  .login-access {
    align-items: flex-start;

    padding:
      22px
      14px
      30px;
  }


  .login-access-inner {
    margin: auto 0;
  }


  .login-card {
    padding:
      22px
      18px;

    border-radius: 16px;
  }


  .login-card-header h2 {
    font-size: 27px;
  }


  .login-input-shell {
    min-height: 50px;
  }


  .login-input-shell input {
    height: 48px;

    font-size: 12px;
  }


  .login-input-icon {
    width: 46px;
    height: 48px;
  }


  .login-submit {
    min-height: 50px;
  }


  .login-access-footer {
    margin-top: 14px;
  }

}


/* =========================================================
   VERY SMALL
   ========================================================= */

@media (
  max-width: 360px
) {

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


  .login-card-header h2 {
    font-size: 25px;
  }


  .login-card-header p {
    font-size: 12px;
  }

}


/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes loginLeftEnter {

  from {
    opacity: 0;

    transform:
      translateX(-22px);
  }

  to {
    opacity: 1;

    transform:
      translateX(0);
  }

}


@keyframes loginRightEnter {

  from {
    opacity: 0;

    transform:
      translateX(22px);
  }

  to {
    opacity: 1;

    transform:
      translateX(0);
  }

}


@keyframes loginContentEnter {

  from {
    opacity: 0;

    transform:
      translateY(18px);
  }

  to {
    opacity: 1;

    transform:
      translateY(0);
  }

}


@keyframes loginMobileBrandEnter {

  from {
    opacity: 0;

    transform:
      translateY(-8px);
  }

  to {
    opacity: 1;

    transform:
      translateY(0);
  }

}


@keyframes loginGridMove {

  from {
    background-position:
      0
      0;
  }

  to {
    background-position:
      54px
      54px;
  }

}


@keyframes loginOrbFloat {

  0%,
  100% {
    transform:
      translate3d(
        0,
        0,
        0
      )
      scale(1);
  }

  50% {
    transform:
      translate3d(
        26px,
        -22px,
        0
      )
      scale(1.07);
  }

}


@keyframes loginPulse {

  0%,
  100% {
    opacity: 1;

    transform:
      scale(1);
  }

  50% {
    opacity: 0.55;

    transform:
      scale(0.85);
  }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (
  prefers-reduced-motion: reduce
) {

  .login-grid,
  .login-orb,
  .login-label-dot,
  .login-presentation,
  .login-presentation-content,
  .login-access,
  .login-mobile-brand {
    animation: none !important;
  }


  .login-submit,
  .login-feature,
  .login-input-shell,
  .login-password-toggle {
    transition: none !important;
  }

}