/* ==========================================================================
   DomandHost — Estudio Digital · Consola Login Institucional
   Tarjeta blanca limpia sobre fondo morado glass completo
   ========================================================================== */

:root {
  color-scheme: light;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;

  --dh-deep: #1D0235;
  --dh-bg-dark: #290347;
  --dh-primary: #46067C;
  --dh-mid: #59058D;
  --dh-intense: #65049C;
  --dh-vivid: #7906B5;
  --dh-accent: #C44BEF;
  --dh-lilac: #E9A3FA;
  --dh-logo-bg: #450280;

  --dh-ink: #21152D;
  --dh-ink-soft: #665578;
  --dh-border: #E5D8EF;
  --dh-input-bg: #FAF7FD;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--dh-bg-dark);
  color: var(--dh-ink);
}

/* Fondo morado glass completo con profundidad atmosférica */
.login-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 36px 20px 32px;
  overflow: hidden;
  background-color: var(--dh-deep);
  background-image:
    radial-gradient(62% 54% at 14% 12%, rgba(196, 75, 239, 0.34) 0%, rgba(196, 75, 239, 0) 68%),
    radial-gradient(56% 52% at 88% 84%, rgba(121, 6, 181, 0.44) 0%, rgba(121, 6, 181, 0) 70%),
    radial-gradient(48% 42% at 80% 16%, rgba(233, 163, 250, 0.16) 0%, rgba(233, 163, 250, 0) 65%),
    linear-gradient(145deg, #290347 0%, #39066B 46%, #46067C 100%);
}

/* Malla sutil y halo glass de fondo */
.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 20%, transparent 100%);
}

.login-page::after {
  content: "";
  position: fixed;
  width: 560px;
  height: 560px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 75, 239, 0.24) 0%, rgba(101, 4, 156, 0.08) 45%, transparent 72%);
  filter: blur(36px);
  pointer-events: none;
}

.dh-login-brand,
.login-glass-frame,
.page-note {
  position: relative;
  z-index: 2;
}

/* Cabecera institucional sobre el fondo morado glass */
.dh-login-brand {
  width: min(100%, 480px);
  margin: 0 0 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dh-brand-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: var(--dh-logo-bg);
  border: 1px solid rgba(233, 163, 250, 0.34);
  box-shadow:
    0 14px 36px rgba(15, 2, 28, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.dh-brand-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(233, 163, 250, 0.62);
  box-shadow:
    0 18px 42px rgba(15, 2, 28, 0.52),
    0 0 24px rgba(196, 75, 239, 0.28);
}

.dh-brand-logo {
  display: block;
  width: clamp(180px, 46vw, 224px);
  height: auto;
  object-fit: contain;
}

.managed-services-title {
  margin: 0 0 4px;
  color: var(--dh-lilac);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.3;
  text-transform: uppercase;
}

.managed-services-subtitle {
  margin: 0;
  color: rgba(247, 243, 251, 0.88);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  text-wrap: balance;
}

/* Marco glass translúcido rodeando la tarjeta blanca limpia */
.login-glass-frame {
  width: min(100%, 456px);
  padding: 10px;
  border-radius: 26px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(233, 163, 250, 0.08) 50%,
    rgba(255, 255, 255, 0.06) 100%
  );
  border: 1px solid rgba(233, 163, 250, 0.30);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow:
    0 32px 84px rgba(10, 1, 22, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

/* Tarjeta blanca limpia institucional */
.login-card {
  width: 100%;
  padding: 36px 36px 30px;
  border-radius: 18px;
  background: #FFFFFF;
  border: 1px solid rgba(229, 216, 239, 0.9);
  box-shadow: 0 10px 30px rgba(33, 21, 45, 0.08);
}

.card-heading {
  margin: 0 0 26px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: #F6EEFC;
  border: 1px solid #E8D5F8;
  color: var(--dh-intense);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--dh-ink);
  font-size: clamp(23px, 5vw, 27px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.card-heading > p {
  margin: 8px 0 0;
  color: var(--dh-ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
}

form {
  display: grid;
  gap: 16px;
}

.field-group {
  display: grid;
  gap: 7px;
}

label {
  color: var(--dh-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--dh-border);
  border-radius: 11px;
  background: var(--dh-input-bg);
  color: var(--dh-ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input::placeholder {
  color: #A091B0;
  font-weight: 400;
}

input:hover {
  border-color: #D2B6E8;
}

input:focus,
input:focus-visible {
  outline: none;
  background: #FFFFFF;
  border-color: var(--dh-accent);
  box-shadow: 0 0 0 4px rgba(196, 75, 239, 0.16);
}

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

.password-wrap input {
  padding-right: 48px;
}

.pw-toggle-btn {
  position: absolute;
  right: 6px;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: #7E6B91;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.pw-toggle-btn:hover {
  color: var(--dh-intense);
  background: rgba(196, 75, 239, 0.10);
}

.pw-toggle-btn:focus-visible {
  outline: 2px solid var(--dh-accent);
  outline-offset: 2px;
}

.pw-toggle-btn .eye-icon {
  width: 19px;
  height: 19px;
  display: block;
  pointer-events: none;
}

button[type="submit"] {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 50px;
  margin-top: 4px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #4B087F 0%, #65049C 55%, #8418C4 100%);
  color: #FFFFFF;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(101, 4, 156, 0.28);
  transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button[type="submit"] .btn-arrow {
  font-size: 17px;
  transition: transform 0.18s ease;
}

button[type="submit"]:hover:not(:disabled) {
  background: linear-gradient(135deg, #59058D 0%, #7906B5 50%, #C44BEF 100%);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(121, 6, 181, 0.38);
}

button[type="submit"]:hover:not(:disabled) .btn-arrow {
  transform: translateX(3px);
}

button[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
}

button[type="submit"]:disabled {
  opacity: 0.68;
  cursor: wait;
}

.error {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #F3C4CE;
  border-radius: 10px;
  background: #FFF3F6;
  color: #9F1D3A;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #EFE6F7;
  color: var(--dh-ink-soft);
  font-size: 12.5px;
}

.card-footer a {
  color: var(--dh-intense);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.16s ease;
}

.card-footer a:hover {
  color: var(--dh-accent);
  text-decoration: underline;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #7E6B91;
  font-weight: 600;
}

.page-note {
  margin: 22px 0 0;
  color: rgba(233, 216, 245, 0.78);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
}

.page-note a {
  color: var(--dh-lilac);
  font-weight: 600;
  text-decoration: none;
}

.page-note a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .login-page {
    padding: 24px 14px 24px;
  }
  .login-glass-frame {
    padding: 8px;
    border-radius: 22px;
  }
  .login-card {
    padding: 26px 22px 22px;
    border-radius: 15px;
  }
  .dh-brand-pill {
    padding: 8px 18px;
    border-radius: 14px;
  }
  h1 {
    font-size: 22px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .login-page {
    justify-content: flex-start;
    padding-top: 20px;
    padding-bottom: 20px;
  }
  .dh-login-brand {
    margin-bottom: 12px;
  }
  .dh-brand-pill {
    padding: 7px 16px;
    margin-bottom: 8px;
  }
  .dh-brand-logo {
    width: 165px;
  }
  .login-card {
    padding: 22px 26px 20px;
  }
  .card-heading {
    margin-bottom: 16px;
  }
  input {
    height: 42px;
  }
  button[type="submit"] {
    min-height: 44px;
  }
  .card-footer {
    margin-top: 16px;
    padding-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001s !important;
  }
}
