@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --blue: #087fc3;
  --blue-dark: #075a94;
  --green: #72bd2d;
  --green-dark: #36a83f;
  --ink: #123044;
  --muted: #718293;
  --white: #ffffff;
  --line: #e2eaf0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  overflow: hidden;
  background: #f7fafc;
}

.background,
.background::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.background {
  background:
    radial-gradient(circle at 12% 20%, rgba(8,127,195,.10), transparent 28%),
    radial-gradient(circle at 88% 82%, rgba(114,189,45,.13), transparent 30%),
    linear-gradient(135deg, #fbfdff 0%, #f1f7fa 100%);
  z-index: -3;
}

.grid {
  position: absolute;
  inset: 0;
  opacity: .35;
  background-image:
    linear-gradient(rgba(8,127,195,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8,127,195,.04) 1px, transparent 1px);
  background-size: 45px 45px;
  mask-image: linear-gradient(to bottom, black, transparent);
}

.orb {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .16;
  animation: float 9s ease-in-out infinite;
}
.orb-blue { background: var(--blue); left: -180px; top: -160px; }
.orb-green { background: var(--green); right: -180px; bottom: -170px; animation-delay: -4s; }

.hidden { display: none !important; }

/* INTRO */
.intro-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 10;
  background: rgba(249,252,253,.96);
  transition: opacity .8s ease, visibility .8s ease;
}
.intro-screen.exit {
  opacity: 0;
  visibility: hidden;
}

.intro-content {
  text-align: center;
  animation: introIn 1.45s cubic-bezier(.16,1,.3,1) both;
}

.logo-wrap {
  position: relative;
  width: 235px;
  height: 235px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
}
.logo-ring {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(8,127,195,.15);
  border-top-color: var(--blue);
  border-right-color: var(--green);
  border-radius: 50%;
  animation: spin 4.8s cubic-bezier(.65,0,.35,1) infinite;
}
.logo-ring::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(114,189,45,.25);
  border-radius: 50%;
}
.logo {
  object-fit: contain;
  display: block;
}
.intro-logo {
  width: 170px;
  height: 170px;
  filter: drop-shadow(0 18px 24px rgba(14,75,105,.16));
  animation: logoPulse 3.1s ease-in-out infinite;
}
.intro-title {
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1;
  letter-spacing: .12em;
  font-weight: 800;
  background: linear-gradient(100deg, var(--blue-dark), var(--blue), var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.intro-subtitle {
  margin: 12px 0 26px;
  color: #657786;
  font-size: 14px;
  letter-spacing: .04em;
}
.loading {
  display: flex;
  justify-content: center;
  gap: 7px;
}
.loading span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  animation: dots 1.1s infinite ease-in-out;
}
.loading span:nth-child(2) { background: #3da979; animation-delay: .15s; }
.loading span:nth-child(3) { background: var(--green); animation-delay: .3s; }

/* LOGIN */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px 72px;
  position: relative;
  animation: pageIn .8s cubic-bezier(.16,1,.3,1) both;
}

.login-card {
  width: min(440px, 100%);
  padding: 34px 38px 28px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 28px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(22px);
  box-shadow: 0 28px 80px rgba(31,70,92,.14), 0 2px 8px rgba(31,70,92,.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
}
.login-logo { width: 82px; height: 82px; }
.brand h1 { margin: 0; font-size: 24px; letter-spacing: .08em; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.eyebrow {
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
}
.welcome h2 {
  margin: 7px 0 5px;
  font-size: 30px;
  letter-spacing: -.03em;
}
.welcome p { margin: 0 0 25px; color: var(--muted); font-size: 13px; }

form label {
  display: block;
  margin: 15px 0 8px;
  font-size: 12px;
  font-weight: 700;
}
.input-box {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdfe;
  transition: .2s ease;
}
.input-box:focus-within {
  border-color: rgba(8,127,195,.55);
  box-shadow: 0 0 0 4px rgba(8,127,195,.08);
  background: white;
}
.input-icon { color: var(--blue); font-size: 12px; }
.input-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.input-box input::placeholder { color: #9aa9b4; }
.eye {
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 16px 0 22px;
  font-size: 11px;
}
.remember { margin: 0; display: flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 500; }
.remember input { accent-color: var(--blue); }
.options a { color: var(--blue-dark); text-decoration: none; font-weight: 700; }

.login-button {
  width: 100%;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  border-radius: 15px;
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  background: linear-gradient(105deg, var(--blue-dark), var(--blue) 52%, var(--green-dark));
  box-shadow: 0 12px 24px rgba(8,127,195,.20);
  transition: transform .2s ease, box-shadow .2s ease;
}
.login-button:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(8,127,195,.26); }
.login-button:active { transform: translateY(0); }
.arrow { font-size: 19px; transition: transform .2s; }
.login-button:hover .arrow { transform: translateX(4px); }

.message {
  min-height: 18px;
  margin: 12px 0 0;
  text-align: center;
  font-size: 11px;
  color: #d34b4b;
}
.security {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin-top: 22px;
  color: #8999a5;
  font-size: 10px;
}
.shield {
  display: grid;
  place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 10px;
  font-weight: 800;
}
footer {
  position: absolute;
  bottom: 22px;
  color: #91a0aa;
  font-size: 10px;
}
footer span { color: var(--blue-dark); font-weight: 800; }

@keyframes introIn {
  from { opacity: 0; transform: translateY(20px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes logoPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}
@keyframes dots {
  0%,100% { transform: translateY(0); opacity: .35; }
  50% { transform: translateY(-5px); opacity: 1; }
}
@keyframes float {
  0%,100% { transform: translate(0,0); }
  50% { transform: translate(25px,-20px); }
}

@media (max-width: 520px) {
  .logo-wrap { width: 205px; height: 205px; }
  .intro-logo { width: 145px; height: 145px; }
  .login-card { padding: 28px 22px 24px; border-radius: 22px; }
  .welcome h2 { font-size: 27px; }
  footer { text-align: center; padding: 0 20px; }
}


/* Refinamiento de la intro SAIEP */
.intro-title {
  animation: titleReveal 1.25s .25s cubic-bezier(.16,1,.3,1) both;
}
.intro-subtitle {
  animation: subtitleReveal 1.1s .55s cubic-bezier(.16,1,.3,1) both;
}
.loading {
  animation: loadingReveal .9s .85s ease both;
}
.logo-wrap {
  animation: logoFloat 4.2s .2s ease-in-out infinite;
}
@keyframes titleReveal {
  from { opacity: 0; transform: translateY(12px); letter-spacing: .18em; }
  to { opacity: 1; transform: translateY(0); letter-spacing: .12em; }
}
@keyframes subtitleReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes loadingReveal {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes logoFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
