/* ==========================================================================
   ANSEC Webmail Gateway - versión compacta verificada para escritorio.
   ========================================================================== */

:root {
  --ink: #080a0f;
  --panel: #151515;
  --panel-soft: rgba(31, 32, 35, 0.86);
  --gold: #c5a65a;
  --gold-light: #ecd781;
  --text: #f7f1e4;
  --muted: #c6bda8;
  --faint: #8d887c;
  --line: rgba(236, 215, 129, 0.18);
  --line-strong: rgba(236, 215, 129, 0.34);
  --focus: #ffe18b;
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ink);
  color-scheme: dark;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a,
button {
  font: inherit;
}

a {
  color: inherit;
}

button {
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 30;
  transform: translateY(-140%);
  border-radius: var(--radius);
  background: var(--gold-light);
  color: #141006;
  padding: 0.7rem 0.9rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.access-shell {
  display: grid;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  grid-template-columns: 56.5vw 43.5vw;
  overflow: hidden;
  background: #0b0c0f;
}

.institutional-panel,
.entry-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.institutional-panel {
  overflow: hidden;
  background: #061735;
}

.entry-panel {
  overflow: visible;
}

.hero-image,
.hero-overlay,
.hero-reflection {
  position: absolute;
  inset: 0;
}

.hero-image {
  background-image: url("assets/images/torre1.jpeg");
  background-position: center;
  background-size: cover;
  filter: saturate(0.92) contrast(1.04);
  transform: none;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(0, 22, 60, 0.72), rgba(6, 50, 118, 0.54)),
    linear-gradient(180deg, rgba(1, 8, 22, 0.05), rgba(1, 7, 18, 0.5));
}

.hero-reflection {
  background:
    linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.1) 47%, transparent 58%),
    radial-gradient(circle at 47% 52%, rgba(255, 255, 255, 0.08), transparent 17rem);
  opacity: 0.3;
  pointer-events: none;
  animation: glassSweep 13s ease-in-out infinite;
}

.institutional-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.brand-lockup {
  position: absolute;
  top: clamp(2rem, 6vh, 4rem);
  left: clamp(2rem, 4vw, 4.2rem);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.78rem;
  width: min(25rem, 78%);
  border: 1px solid rgba(236, 215, 129, 0.16);
  border-left-color: rgba(236, 215, 129, 0.46);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  background: rgba(5, 16, 38, 0.26);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
}

.national-seal {
  width: clamp(2.7rem, 3.5vw, 3.9rem);
  height: auto;
  object-fit: contain;
  opacity: 0.92;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.32));
}

.brand-lockup p {
  margin: 0;
  color: rgba(247, 241, 228, 0.88);
  font-size: clamp(0.63rem, 0.72vw, 0.78rem);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brand-lockup p + p {
  margin-top: 0.22rem;
  color: rgba(247, 241, 228, 0.62);
  font-size: clamp(0.56rem, 0.58vw, 0.64rem);
  font-weight: 700;
}

.government-brand {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(29rem, 44vw);
  opacity: 0.56;
  transform: translate(-50%, -48%);
  filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.36));
}

.institutional-copy {
  position: absolute;
  left: clamp(2rem, 4vw, 4.2rem);
  bottom: clamp(1.5rem, 5vh, 3.3rem);
  width: min(26rem, 78%);
}

.eyebrow,
.section-label {
  margin: 0 0 0.45rem;
  color: var(--gold-light);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before,
.section-label::before {
  display: inline-block;
  width: 1.15rem;
  height: 1px;
  margin-right: 0.65rem;
  transform: translateY(-0.25rem);
  background: var(--gold);
  content: "";
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 17ch;
  margin-bottom: 0.45rem;
  color: var(--text);
  font-size: clamp(1.55rem, 2.35vw, 2.45rem);
  font-weight: 800;
  line-height: 1.04;
}

.institutional-copy p:last-child {
  max-width: 24rem;
  margin-bottom: 0;
  color: rgba(247, 241, 228, 0.74);
  font-size: clamp(0.78rem, 0.82vw, 0.9rem);
}

.entry-panel {
  display: grid;
  place-items: center;
  padding: clamp(1rem, 2.2vw, 2.2rem);
  background:
    radial-gradient(circle at 83% 9%, rgba(197, 166, 90, 0.12), transparent 20rem),
    linear-gradient(145deg, #080a0d, #171612 82%);
}

.entry-panel::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 44px 44px;
  content: "";
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.ambient-light {
  position: absolute;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  filter: blur(76px);
  pointer-events: none;
}

.ambient-light-top {
  top: -9rem;
  right: -7rem;
  background: rgba(197, 166, 90, 0.12);
}

.ambient-light-bottom {
  bottom: -10rem;
  left: -7rem;
  background: rgba(14, 47, 107, 0.18);
}

.entry-card {
  position: relative;
  z-index: 1;
  width: min(24.5rem, calc(100% - 2rem));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(0.85rem, 1.3vw, 1.1rem);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    var(--panel-soft);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.entry-card::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(112deg, transparent, rgba(236, 215, 129, 0.08), transparent 58%);
  content: "";
  pointer-events: none;
}

.entry-header {
  position: relative;
}

.ansec-logo {
  width: min(15.5rem, 84%);
  height: auto;
  max-height: 4.9rem;
  margin: 0 auto 0.75rem;
  object-fit: contain;
  aspect-ratio: 413 / 120;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.28));
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  margin: 0 0 0.55rem;
  border: 1px solid rgba(236, 215, 129, 0.16);
  border-radius: 999px;
  padding: 0.22rem 0.52rem;
  background: rgba(5, 8, 13, 0.28);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.secure-badge span {
  color: #93d49d;
  font-size: 0.7rem;
}

h2 {
  margin-bottom: 0.28rem;
  color: var(--text);
  font-size: clamp(1.24rem, 1.55vw, 1.55rem);
  line-height: 1.08;
}

.entry-header p:last-child {
  max-width: 19rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.redirect-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.58rem;
  margin-bottom: 0.56rem;
  border: 1px solid rgba(236, 215, 129, 0.14);
  border-radius: var(--radius);
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
}

.redirect-assist {
  margin: -0.2rem 0 0.5rem;
  color: var(--faint);
  font-size: 0.75rem;
}

.countdown-orbit {
  position: relative;
  display: grid;
  width: 2.85rem;
  height: 2.85rem;
  place-items: center;
}

.countdown-spinner {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(236, 215, 129, 0.18);
  border-top-color: var(--gold-light);
  border-radius: 50%;
  animation: spin 1200ms linear infinite;
}

.countdown-number {
  color: var(--gold-light);
  font-size: 1.05rem;
  line-height: 1;
}

.redirect-copy p {
  margin-bottom: 0.08rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.redirect-seconds {
  color: var(--text);
  font-weight: 800;
}

.progress-track {
  height: 0.22rem;
  margin-bottom: 0.58rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a98a3e, var(--gold-light));
  box-shadow: 0 0 16px rgba(236, 215, 129, 0.32);
  transition: width 260ms linear;
}

.action-group {
  display: grid;
  gap: 0.44rem;
}

.primary-action,
.secondary-action {
  min-height: 2.35rem;
  border-radius: var(--radius);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #b99d4f, #ecd781 50%, #927435);
  color: #151007;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.primary-action:hover {
  transform: translateY(-1px);
}

.primary-action:active,
.secondary-action:active {
  transform: translateY(0);
}

.action-arrow {
  font-size: 1.08rem;
  line-height: 1;
}

.secondary-action {
  border: 1px solid rgba(236, 215, 129, 0.15);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.secondary-action:hover {
  border-color: rgba(236, 215, 129, 0.28);
  background: rgba(255, 255, 255, 0.065);
  color: var(--text);
}

.support-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.52rem;
  margin-top: 0.58rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 0.58rem;
  background: rgba(5, 8, 13, 0.4);
}

.support-icon {
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border: 1px solid rgba(236, 215, 129, 0.32);
  border-radius: 50%;
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 900;
}

.support-card h3 {
  margin-bottom: 0.34rem;
  font-size: 0.76rem;
}

.support-card dl,
.support-card dd {
  margin: 0;
}

.support-card dl {
  display: grid;
  gap: 0.3rem;
}

.support-card dt {
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.support-card dd {
  color: var(--muted);
  font-size: 0.78rem;
}

.support-card a {
  color: var(--gold-light);
  text-decoration-color: rgba(236, 215, 129, 0.4);
  text-underline-offset: 0.18em;
}

.site-footer {
  position: absolute;
  right: clamp(1rem, 2.2vw, 2.2rem);
  bottom: 0.82rem;
  left: clamp(1rem, 2.2vw, 2.2rem);
  z-index: 1;
  color: var(--faint);
  font-size: 0.75rem;
  text-align: center;
}

.site-footer p {
  margin-bottom: 0.12rem;
}

.noscript-message {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 40;
  border: 1px solid rgba(236, 215, 129, 0.32);
  border-radius: var(--radius);
  padding: 0.9rem;
  background: #161207;
  color: var(--text);
  text-align: center;
}

body.is-paused .countdown-spinner {
  animation-play-state: paused;
}

body.is-redirecting .primary-action {
  pointer-events: none;
}

body.is-redirecting .countdown-spinner {
  animation-duration: 700ms;
}

@keyframes glassSweep {
  0%,
  100% {
    transform: translateX(-3%);
    opacity: 0.25;
  }

  50% {
    transform: translateX(4%);
    opacity: 0.38;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 62.01rem) {
  .access-shell {
    min-height: 100svh;
    grid-template-columns: minmax(0, 1fr) minmax(24rem, 28rem);
  }

  .institutional-panel,
  .entry-panel {
    min-height: 100svh;
  }

  .institutional-content {
    height: 100%;
    min-height: 0;
  }

  .brand-lockup {
    display: grid;
    top: clamp(1.35rem, 4vh, 2.8rem);
    left: clamp(1.6rem, 3.2vw, 3.4rem);
    width: min(25rem, 72%);
  }

  .government-brand {
    width: clamp(17rem, 27vw, 28rem);
    opacity: 0.58;
    transform: translate(-50%, -50%);
  }

  .institutional-copy {
    display: block;
    left: clamp(1.6rem, 3.2vw, 3.4rem);
    bottom: clamp(1.25rem, 3.6vh, 2.6rem);
    width: min(25rem, 72%);
  }

  .institutional-copy h1 {
    font-size: clamp(1.5rem, 2.25vw, 2.45rem);
  }

  .institutional-copy p:last-child {
    font-size: clamp(0.76rem, 0.82vw, 0.88rem);
  }

  .entry-panel {
    display: grid;
    grid-template-rows: auto auto;
    align-content: center;
    justify-items: center;
    gap: 0.6rem;
    padding: 1rem;
  }

  .entry-card {
    width: min(100%, 24.5rem);
    padding: 1rem;
  }

  .ansec-logo {
    width: 15rem;
    margin-bottom: 0.7rem;
  }

  .section-label {
    margin-bottom: 0.28rem;
    font-size: 0.75rem;
  }

  h2 {
    font-size: 1.32rem;
  }

  .entry-header p:last-child {
    margin-bottom: 0.62rem;
    font-size: 0.72rem;
  }

  .redirect-status {
    gap: 0.48rem;
    margin-bottom: 0.48rem;
    padding: 0.46rem;
  }

  .countdown-orbit {
    width: 2.55rem;
    height: 2.55rem;
  }

  .countdown-number {
    font-size: 0.96rem;
  }

  .redirect-copy p {
    font-size: 0.76rem;
  }

  .progress-track {
    margin-bottom: 0.5rem;
  }

  .primary-action,
  .secondary-action {
    min-height: 2.16rem;
  }

  .primary-action {
    font-size: 0.82rem;
  }

  .secondary-action {
    font-size: 0.76rem;
  }

  .support-card {
    gap: 0.45rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
  }

  .support-icon {
    width: 1.28rem;
    height: 1.28rem;
    font-size: 0.72rem;
  }

  .support-card h3 {
    margin-bottom: 0.25rem;
    font-size: 0.82rem;
  }

  .support-card dl {
    gap: 0.22rem;
  }

  .support-card dt {
    font-size: 0.72rem;
  }

  .support-card dd {
    font-size: 0.75rem;
  }

  .site-footer {
    position: relative;
    inset: auto;
    width: min(100%, 24.5rem);
    margin-top: 0;
    font-size: 0.72rem;
  }
}

@media (max-height: 760px) and (min-width: 62.01rem) {
  .entry-card {
    width: min(23rem, calc(100% - 2rem));
    padding: 0.72rem;
  }

  .ansec-logo {
    width: 13.5rem;
    margin-bottom: 0.48rem;
  }

  .secure-badge {
    margin-bottom: 0.36rem;
    font-size: 0.7rem;
  }

  .section-label,
  .eyebrow {
    margin-bottom: 0.28rem;
    font-size: 0.7rem;
  }

  h2 {
    font-size: 1.22rem;
  }

  .entry-header p:last-child,
  .redirect-copy p,
  .support-card dd,
  .redirect-assist {
    font-size: 0.72rem;
  }

  .redirect-status,
  .support-card {
    padding: 0.46rem;
  }

  .primary-action,
  .secondary-action {
    min-height: 2.12rem;
  }

  .government-brand {
    width: clamp(15rem, 24vw, 23rem);
  }

  .support-card {
    padding: 0.42rem;
  }

  .institutional-copy h1 {
    font-size: clamp(1.3rem, 1.9vw, 2rem);
  }

  .institutional-copy p:last-child {
    font-size: 0.7rem;
  }
}

@media (max-width: 62rem) {
  body {
    overflow-y: auto;
  }

  .access-shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .institutional-panel {
    min-height: 42vh;
  }

  .entry-panel {
    min-height: 58vh;
    padding: 1rem;
  }

  .brand-lockup {
    top: 1rem;
    left: 1rem;
    width: calc(100% - 2rem);
    padding: 0.48rem 0.6rem;
  }

  .national-seal {
    width: 2.45rem;
  }

  .government-brand {
    width: min(24rem, 78vw);
  }

  .institutional-copy {
    left: 1.2rem;
    bottom: 1.2rem;
    width: calc(100% - 2.4rem);
  }

  .entry-card {
    width: min(100%, 24rem);
  }

  .ansec-logo {
    width: min(14.2rem, 82%);
  }

  .site-footer {
    position: relative;
    inset: auto;
    margin-top: 0.8rem;
  }
}

@media (max-width: 38rem) {
  .redirect-status,
  .support-card {
    grid-template-columns: 1fr;
  }

  .countdown-orbit {
    width: 3.35rem;
    height: 3.35rem;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }
}

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