:root {
      --bg-1: #ffffff;
      --bg-2: #f4f5f7;
      --bg-3: #e7eaef;
      --glass: rgba(255, 255, 255, 0.55);
      --glass-border: rgba(55,65,81, 0.18);
      --text: #374151;
      --muted: rgba(55,65,81, 0.72);
      --input: rgba(255, 255, 255, 0.8);
      --input-border: rgba(55,65,81, 0.22);
      --accent: #9ca3af;
      --accent-dark: #4b5563;
      --line: rgba(55,65,81, 0.22);
      --chip: #dca34a;
    }

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

    html,
    body {
      width: 100%;
      min-height: 100%;
      font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
      color: var(--text);
    }

    body {
      overflow: hidden;
      background:
        radial-gradient(circle at 14% 10%, rgba(156,163,175,.08), transparent 26%),
        radial-gradient(circle at 88% 16%, rgba(156,163,175,.10), transparent 22%),
        linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 48%, var(--bg-3) 100%);
    }

    .page {
      min-height: 100vh;
      min-height: 100dvh;
      height: 100dvh;
      display: grid;
      place-items: center;
      position: relative;
      isolation: isolate;
      overflow: hidden;
      padding: clamp(12px, 2.2vh, 28px) clamp(14px, 3vw, 24px);
    }

    .page::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: -4;
      background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
      background-size: 48px 48px;
      mask-image: linear-gradient(to bottom, transparent, black 25%, black 80%, transparent);
    }

    .glow {
      position: absolute;
      border-radius: 999px;
      filter: blur(20px);
      opacity: .45;
      z-index: -3;
      animation: floatGlow 10s ease-in-out infinite alternate;
    }

    .glow.one {
      width: 420px;
      height: 420px;
      left: -160px;
      bottom: -120px;
      background: rgba(156,163,175, .22);
    }

    .glow.two {
      width: 320px;
      height: 320px;
      right: -100px;
      top: -80px;
      background: rgba(156,163,175, .16);
      animation-delay: -4s;
    }

    @keyframes floatGlow {
      to {
        transform: translate3d(40px, -28px, 0) scale(1.08);
      }
    }

    .login-card {
      width: min(400px, 100%);
      max-height: calc(100dvh - clamp(24px, 5vh, 56px));
      overflow: auto;
      scrollbar-width: none;
      padding: clamp(20px, 3.4vh, 32px) clamp(22px, 3vw, 34px) clamp(16px, 2.6vh, 24px);
      border: 1px solid var(--glass-border);
      border-radius: 28px;
      background:
        linear-gradient(145deg, rgba(255,255,255,.72), rgba(255,255,255,.52));
      backdrop-filter: blur(24px) saturate(140%);
      -webkit-backdrop-filter: blur(24px) saturate(140%);
      box-shadow:
        0 28px 70px rgba(20, 0, 4, .42),
        inset 0 1px 0 rgba(255,255,255,.2);
      position: relative;
      overflow: hidden;
      animation: cardEntrance 1s cubic-bezier(.2,.8,.2,1) both;
    }

    .login-card::before {
      content: "";
      position: absolute;
      inset: -2px;
      border-radius: inherit;
      padding: 1px;
      background: linear-gradient(
        125deg,
        rgba(255,255,255,.65),
        rgba(255,255,255,.05) 32%,
        rgba(255,255,255,.22) 62%,
        rgba(255,255,255,.05)
      );
      -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
      opacity: .75;
      pointer-events: none;
    }

    .login-card::after {
      content: "";
      position: absolute;
      width: 220px;
      height: 220px;
      left: -110px;
      top: -120px;
      border-radius: 50%;
      background: rgba(255,255,255,.12);
      filter: blur(3px);
      pointer-events: none;
    }

    @keyframes cardEntrance {
      0% {
        opacity: 0;
        transform: translateY(34px) scale(.96);
        filter: blur(8px);
      }
      100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
      }
    }

    .brand {
      text-align: center;
      margin-bottom: clamp(14px, 2.6vh, 22px);
      position: relative;
      z-index: 2;
    }

    /* --- Logo: entrada con giro 3D + flotacion continua --- */
    .logo-stage {
      width: clamp(48px, 7.5vh, 68px);
      height: clamp(48px, 7.5vh, 68px);
      margin: 0 auto clamp(8px, 1.4vh, 12px);
      perspective: 700px;
      display: grid;
      place-items: center;
    }

    .logo {
      width: 100%;
      height: auto;
      display: block;
      transform-style: preserve-3d;
      backface-visibility: visible;
      filter: drop-shadow(0 10px 22px rgba(0,0,0,.30));
      animation:
        logoEnter 1.5s cubic-bezier(.2,.8,.25,1) both,
        logoFloat 5s ease-in-out 1.5s infinite;
      transition: transform .45s cubic-bezier(.2,.8,.25,1),
                  filter .45s ease;
      cursor: pointer;
    }

    /* Entrada: gira sobre su eje Y y aterriza */
    @keyframes logoEnter {
      0% {
        opacity: 0;
        transform: rotateY(-450deg) scale(.35) translateY(-14px);
        filter: drop-shadow(0 0 0 rgba(0,0,0,0)) blur(4px);
      }
      55% {
        opacity: 1;
        filter: drop-shadow(0 18px 30px rgba(0,0,0,.35)) blur(0);
      }
      75% {
        transform: rotateY(8deg) scale(1.08) translateY(0);
      }
      100% {
        opacity: 1;
        transform: rotateY(0deg) scale(1) translateY(0);
        filter: drop-shadow(0 10px 22px rgba(0,0,0,.30));
      }
    }

    /* Flotacion sutil despues de aterrizar */
    @keyframes logoFloat {
      50% {
        transform: translateY(-7px) rotateY(6deg) rotateX(3deg);
      }
    }

    /* Giro completo al pasar el mouse / al hacer click */
    .logo:hover {
      transform: rotateY(360deg) scale(1.06);
      filter: drop-shadow(0 16px 30px rgba(0,0,0,.38));
      animation-play-state: paused;
    }

    .logo.spin {
      animation: logoSpin .9s cubic-bezier(.3,.7,.2,1);
    }

    @keyframes logoSpin {
      to { transform: rotateY(720deg); }
    }

    @media (prefers-reduced-motion: reduce) {
      .logo {
        animation: none;
        opacity: 1;
        transform: none;
      }
      .logo:hover { transform: none; }
    }

    .brand h1 {
      font-size: clamp(1.45rem, 3.4vh, 1.95rem);
      line-height: 1;
      letter-spacing: -.04em;
      margin-bottom: clamp(4px, .9vh, 8px);
    }

    .brand p {
      color: var(--muted);
      font-size: clamp(.82rem, 1.6vh, .93rem);
    }

    .form-group {
      margin-bottom: clamp(10px, 1.8vh, 16px);
      position: relative;
      z-index: 2;
    }

    label {
      display: block;
      margin-bottom: clamp(4px, .8vh, 7px);
      font-size: clamp(.8rem, 1.5vh, .88rem);
      color: var(--accent-dark);
    }

    .input-wrap {
      position: relative;
    }

    .input-icon {
      position: absolute;
      left: 16px;
      top: 50%;
      width: 19px;
      height: 19px;
      transform: translateY(-50%);
      opacity: .76;
      pointer-events: none;
    }

    input {
      width: 100%;
      height: clamp(42px, 6.2vh, 50px);
      border: 1px solid var(--input-border);
      border-radius: 14px;
      background: var(--input);
      color: var(--accent-dark);
      padding: 0 44px;
      outline: none;
      font-size: 1rem;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
      transition:
        border-color .25s ease,
        background .25s ease,
        box-shadow .25s ease,
        transform .25s ease;
    }

    input::placeholder {
      color: rgba(55,65,81,.42);
    }

    input:focus {
      background: rgba(255,255,255,.95);
      border-color: rgba(156,163,175,.65);
      box-shadow:
        0 0 0 4px rgba(255,255,255,.08),
        inset 0 1px 0 rgba(255,255,255,.12);
      transform: translateY(-1px);
    }

    .toggle-password {
      position: absolute;
      right: 15px;
      top: 50%;
      transform: translateY(-50%);
      background: transparent;
      border: 0;
      color: rgba(55,65,81,.65);
      cursor: pointer;
      width: 28px;
      height: 28px;
      display: grid;
      place-items: center;
      border-radius: 8px;
    }

    .toggle-password:hover {
      background: rgba(55,65,81,.08);
      color: var(--accent-dark);
    }

    .submit {
      width: 100%;
      height: clamp(44px, 6.4vh, 52px);
      border: 0;
      border-radius: 15px;
      color: white;
      font-weight: 800;
      font-size: clamp(.9rem, 1.7vh, 1rem);
      cursor: pointer;
      background:
        linear-gradient(135deg, #9ca3af, var(--accent-dark));
      box-shadow:
        0 14px 32px rgba(55,65,81,.32),
        inset 0 1px 0 rgba(255,255,255,.26);
      position: relative;
      overflow: hidden;
      transition: transform .22s ease, box-shadow .22s ease;
      margin-top: 4px;
      z-index: 2;
    }

    .submit::before {
      content: "";
      position: absolute;
      top: 0;
      left: -130%;
      width: 70%;
      height: 100%;
      background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.4),
        transparent
      );
      transform: skewX(-20deg);
      transition: left .75s ease;
    }

    .submit:hover {
      transform: translateY(-2px);
      box-shadow:
        0 18px 38px rgba(55,65,81,.44),
        inset 0 1px 0 rgba(255,255,255,.3);
    }

    .submit:hover::before {
      left: 150%;
    }

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

    .forgot {
      display: block;
      width: fit-content;
      margin: 22px auto 0;
      color: var(--accent-dark);
      text-decoration: none;
      font-size: .93rem;
      border-bottom: 1px solid rgba(55,65,81,.4);
      position: relative;
      z-index: 2;
    }

    .forgot:hover {
      color: #4b5563;
      border-color: #4b5563;
    }

    .hidden { display: none !important; }
    .login-error { min-height: 18px; color: #b42335; text-align: center; font-size: .78rem; margin-top: 12px; position: relative; z-index: 2; }
    select {
      width: 100%;
      height: clamp(42px, 6.2vh, 50px);
      border: 1px solid var(--input-border);
      border-radius: 14px;
      background: var(--input);
      color: var(--accent-dark);
      padding: 0 14px;
      outline: none;
      font-size: .84rem;
    }
    .first-login-copy { color: var(--muted); font-size: .76rem; line-height: 1.45; margin: -4px 0 14px; position: relative; z-index: 2; }

    /* Tarjetas minimalistas animadas */
    .credit-card {
      position: absolute;
      width: 420px;
      height: 250px;
      z-index: -2;
      opacity: .82;
      pointer-events: none;
      filter: drop-shadow(0 24px 30px rgba(0,0,0,.16));
    }

    .credit-card.left {
      left: 5%;
      top: 16%;
      transform: rotate(-16deg);
      animation: driftLeft 9s ease-in-out infinite alternate;
    }

    .credit-card.right {
      right: 1%;
      bottom: 8%;
      transform: rotate(13deg);
      animation: driftRight 10s ease-in-out infinite alternate;
      animation-delay: -3s;
    }

    @keyframes driftLeft {
      to {
        transform: translate3d(24px, 18px, 0) rotate(-12deg);
      }
    }

    @keyframes driftRight {
      to {
        transform: translate3d(-22px, -14px, 0) rotate(9deg);
      }
    }

    .card-outline {
      fill: rgba(255,255,255,.03);
      stroke: var(--line);
      stroke-width: 2.4;
      stroke-dasharray: 1200;
      stroke-dashoffset: 1200;
      animation:
        drawCard 3.8s cubic-bezier(.7,0,.3,1) forwards,
        pulseOutline 4s ease-in-out 4s infinite;
    }

    .left .card-outline {
      animation-delay: .4s, 4.3s;
    }

    .right .card-outline {
      animation-delay: 1.15s, 5s;
    }

    @keyframes drawCard {
      to {
        stroke-dashoffset: 0;
      }
    }

    @keyframes pulseOutline {
      50% {
        stroke: rgba(255,255,255,.48);
        filter: drop-shadow(0 0 8px rgba(255,255,255,.15));
      }
    }

    .detail-line {
      fill: none;
      stroke: rgba(255,255,255,.18);
      stroke-linecap: round;
      stroke-width: 10;
      stroke-dasharray: 500;
      stroke-dashoffset: 500;
      animation: drawDetail 1.4s ease-out forwards;
    }

    .detail-line.one { animation-delay: 3.3s; }
    .detail-line.two { animation-delay: 3.6s; }

    .right .detail-line.one { animation-delay: 4s; }
    .right .detail-line.two { animation-delay: 4.3s; }

    @keyframes drawDetail {
      to {
        stroke-dashoffset: 0;
      }
    }

    .chip {
      opacity: 0;
      transform-box: fill-box;
      transform-origin: center;
      transform: scale(.25) rotate(-12deg);
      animation: chipReveal .9s cubic-bezier(.15,.85,.3,1.4) forwards;
      filter: drop-shadow(0 8px 12px rgba(0,0,0,.15));
    }

    .left .chip {
      animation-delay: 4.2s;
    }

    .right .chip {
      animation-delay: 4.9s;
    }

    @keyframes chipReveal {
      65% {
        opacity: 1;
        transform: scale(1.08) rotate(4deg);
      }
      100% {
        opacity: 1;
        transform: scale(1) rotate(0);
      }
    }

    .chip-base {
      fill: var(--chip);
    }

    .chip-line {
      fill: none;
      stroke: rgba(86,48,7,.42);
      stroke-width: 1.6;
    }

    .footer {
      position: absolute;
      left: clamp(16px, 3vw, 38px);
      bottom: clamp(10px, 2vh, 24px);
      color: rgba(55,65,81,.68);
      font-size: clamp(.66rem, 1.25vh, .76rem);
      line-height: 1.5;
      z-index: 2;
    }

    .footer a {
      color: var(--accent-dark);
      text-underline-offset: 4px;
    }

    .footer strong {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      margin-bottom: 4px;
      font-size: clamp(.74rem, 1.4vh, .84rem);
    }


    .login-card::-webkit-scrollbar { display: none; }

    /* Pantallas bajas (laptops 768px de alto o menos, o landscape movil) */
    @media (max-height: 720px) {
      .brand p { display: none; }
      .footer { font-size: .62rem; }
    }

    @media (max-height: 560px) {
      .logo-stage { width: 40px; height: 40px; margin-bottom: 6px; }
      .brand { margin-bottom: 12px; }
      .footer { display: none; }
    }

    @media (max-width: 1100px) {
      .credit-card {
        opacity: .42;
        transform: scale(.85);
      }

      .credit-card.left {
        left: -120px;
      }

      .credit-card.right {
        right: -130px;
      }
    }

    @media (max-width: 720px) {
      .page {
        padding: 14px 14px 70px;
      }

      .login-card {
        padding: 22px 20px 18px;
        border-radius: 23px;
      }

      .credit-card {
        width: 320px;
        height: 190px;
        opacity: .28;
      }

      .credit-card.left {
        left: -150px;
        top: 6%;
      }

      .credit-card.right {
        right: -150px;
        bottom: 12%;
      }

      .footer {
        left: 18px;
        right: 18px;
        bottom: 18px;
        text-align: center;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
      }
    }


/* alpha.77 · Política de Privacidad */
.privacy-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  padding: 0;
}

.privacy-link:hover,
.privacy-link:focus-visible {
  color: #111827;
}

.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 34px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .24s ease, visibility .24s ease;
}

.privacy-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.privacy-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(10px) saturate(115%);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
}

.privacy-dialog {
  position: relative;
  width: min(980px, 96vw);
  max-height: min(88dvh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(247,249,252,.95));
  box-shadow: 0 35px 95px rgba(15,23,42,.32), inset 0 1px 0 rgba(255,255,255,.9);
  transform: translateY(24px) scale(.965);
  opacity: 0;
  transition: transform .34s cubic-bezier(.2,.8,.2,1), opacity .24s ease;
}

.privacy-modal.is-open .privacy-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.privacy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(18px, 2.6vw, 28px) clamp(20px, 3vw, 34px);
  border-bottom: 1px solid rgba(148,163,184,.22);
  background:
    radial-gradient(circle at 8% 10%, rgba(59,130,246,.08), transparent 34%),
    radial-gradient(circle at 86% 0%, rgba(34,197,94,.07), transparent 30%),
    rgba(255,255,255,.82);
}

.privacy-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 16px;
}

.privacy-logo-shell {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(255,255,255,.9);
  box-shadow: 0 12px 28px rgba(15,23,42,.10);
}

.privacy-logo-shell img {
  width: 48px;
  height: auto;
  display: block;
}

.privacy-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font: 800 .68rem/1.2 "Manrope", "DM Sans", sans-serif;
  letter-spacing: .15em;
}

.privacy-header h2 {
  margin: 0;
  color: #263244;
  font: 800 clamp(1.25rem, 2.5vw, 1.72rem)/1.15 "Manrope", "DM Sans", sans-serif;
  letter-spacing: -.025em;
}

.privacy-header p {
  margin: 5px 0 0;
  color: #718096;
  font-size: .85rem;
}

.privacy-close {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 14px;
  background: rgba(255,255,255,.88);
  color: #64748b;
  font: 400 1.75rem/1 "DM Sans", sans-serif;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}

.privacy-close:hover {
  transform: rotate(5deg) scale(1.04);
  background: #fff;
  color: #1f2937;
}

.privacy-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(22px, 3vw, 34px);
  color: #4b5563;
  scrollbar-color: #cbd5e1 transparent;
  scrollbar-width: thin;
}

.privacy-scroll h3 {
  margin: 28px 0 10px;
  padding-top: 3px;
  color: #263244;
  font: 800 1.02rem/1.3 "Manrope", "DM Sans", sans-serif;
}

.privacy-scroll h3:first-of-type { margin-top: 20px; }

.privacy-scroll h4 {
  margin: 18px 0 7px;
  color: #334155;
  font: 750 .91rem/1.35 "Manrope", "DM Sans", sans-serif;
}

.privacy-scroll p {
  margin: 0 0 12px;
  font-size: .88rem;
  line-height: 1.72;
}

.privacy-updated {
  display: inline-flex;
  margin-bottom: 12px !important;
  padding: 7px 11px;
  border: 1px solid rgba(59,130,246,.15);
  border-radius: 999px;
  background: rgba(59,130,246,.07);
  color: #475569;
  font-size: .76rem !important;
  font-weight: 700;
}

.privacy-bullet {
  position: relative;
  padding-left: 20px;
}

.privacy-bullet::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
}

.privacy-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px clamp(20px, 3vw, 34px);
  border-top: 1px solid rgba(148,163,184,.2);
  background: rgba(248,250,252,.94);
}

.privacy-actions span {
  color: #94a3b8;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.privacy-done {
  min-width: 108px;
  height: 42px;
  padding: 0 19px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #64748b, #475569);
  color: #fff;
  font: 700 .84rem/1 "DM Sans", sans-serif;
  cursor: pointer;
  box-shadow: 0 9px 20px rgba(71,85,105,.20);
  transition: transform .18s ease, box-shadow .18s ease;
}

.privacy-done:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(71,85,105,.26);
}

body.privacy-open .login-card,
body.privacy-open .credit-card,
body.privacy-open .footer {
  filter: saturate(.92);
}

@media (max-width: 640px) {
  .privacy-modal { padding: 10px; }
  .privacy-dialog { width: 100%; max-height: 94dvh; border-radius: 24px; }
  .privacy-header { padding: 16px; }
  .privacy-logo-shell { width: 52px; height: 52px; flex-basis: 52px; border-radius: 16px; }
  .privacy-logo-shell img { width: 40px; }
  .privacy-header p { display: none; }
  .privacy-scroll { padding: 20px 18px 24px; }
  .privacy-actions { padding: 13px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .privacy-modal,
  .privacy-dialog,
  .privacy-close,
  .privacy-done { transition: none !important; }
}
