/* EcoBalam — login (port fiel de CRUC Balam css/acceso/login.css).
 * Tipografías: las aporta eco-design.css (Inter + Plus Jakarta Sans).
 */
/*
 * Paleta oficial:
 *   Verde    Pantone 131-6 C   #009887
 *   Magenta  Pantone 69-70 C   #C90166
 *   Rojo     Pantone 53-16 C   #AE192D
 *   Negro    Process Black C   #000000
 *   Beige    Pantone 23-2 C    #D3C2B4
 * El texto blanco sobre #009887 no alcanza contraste 4.5:1; por eso botones y enlaces usan #00796C.
 */
:root {
  --acc-green: #009887;
  --acc-green-dark: #00796c;
  --acc-green-darker: #005f55;
  --acc-magenta: #c90166;
  --acc-red: #ae192d;
  --acc-black: #000000;
  --acc-beige: #d3c2b4;

  --acc-bg: #f8f5f2;
  --acc-surface: rgba(255, 255, 255, 0.72);
  --acc-border: #e6dcd3;
  --acc-border-strong: #d3c2b4;
  --acc-text: #141414;
  --acc-heading: #0a0a0a;
  --acc-muted: #5b5550;
  --acc-subtle: #8a8079;
  --acc-ring: rgba(0, 152, 135, 0.5);
  --acc-danger: #ae192d;
  --acc-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --acc-font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
}

html {
  min-height: 100%;
  background: var(--acc-bg);
}

body.acc-page {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font-family: var(--acc-font);
  font-size: 1rem;
  color: var(--acc-text);
  background-color: var(--acc-bg);
  background-image:
    radial-gradient(ellipse 55% 40% at 50% -8%, rgba(0, 152, 135, 0.16), rgba(0, 152, 135, 0) 72%),
    radial-gradient(ellipse 30% 28% at 88% 2%, rgba(201, 1, 102, 0.07), rgba(201, 1, 102, 0) 70%),
    radial-gradient(ellipse 45% 35% at 8% 100%, rgba(211, 194, 180, 0.35), rgba(211, 194, 180, 0) 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

body.acc-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(174, 150, 130, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(174, 150, 130, 0.14) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 0%, transparent 78%);
  z-index: 0;
}

.acc-page svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.acc-page a,
.acc-page button {
  cursor: pointer;
}

.acc-page :focus-visible {
  outline: 3px solid var(--acc-ring);
  outline-offset: 2px;
}

/* ---------- Estructura ---------- */

.acc-shell {
  position: relative;
  z-index: 1;
  max-width: 1230px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 1.25rem 2.25rem 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26rem;
  grid-template-areas:
    'intro access'
    'features access'
    'institucional access';
  grid-template-rows: auto auto auto;
  align-content: center;
  column-gap: 3.75rem;
}

.acc-intro { grid-area: intro; min-width: 0; }
.acc-features { grid-area: features; min-width: 0; }
.acc-institucional { grid-area: institucional; min-width: 0; }
.acc-access {
  grid-area: access;
  min-width: 0;
  padding-top: 5.05rem;
}

/* ---------- Marca ---------- */

.acc-brand {
  display: flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 0.85rem;
  color: var(--acc-text);
  text-decoration: none;
}

.acc-brand:hover {
  color: var(--acc-text);
}

.acc-brand__icon {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0.65rem;
  border: 1px solid rgba(0, 152, 135, 0.35);
  background: linear-gradient(180deg, rgba(0, 152, 135, 0.14), rgba(0, 121, 108, 0.08));
  color: var(--acc-green-dark);
  font-size: 1.15rem;
}

.acc-brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.acc-brand__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--acc-heading);
}

.acc-brand__sub {
  font-size: 0.78rem;
  color: var(--acc-muted);
}

.acc-pill {
  display: flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.6rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--acc-border-strong);
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  font-weight: 500;
  color: #3d3833;
}

.acc-pill__dot {
  width: 0.4rem;
  height: 0.4rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--acc-magenta);
  box-shadow: 0 0 0 3px rgba(201, 1, 102, 0.16);
}

.acc-headline {
  margin: 1.4rem 0 0;
  font-family: var(--acc-font-display);
  font-weight: 800;
  font-size: clamp(2rem, 3.3vw, 2.6rem);
  line-height: 1.16;
  letter-spacing: -0.025em;
  color: var(--acc-heading);
  max-width: 40rem;
}

.acc-headline__accent {
  color: var(--acc-magenta);
  background: linear-gradient(90deg, var(--acc-magenta), var(--acc-red));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.acc-lead {
  margin: 1.6rem 0 0;
  max-width: 31rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--acc-muted);
}

/* ---------- Funciones ---------- */

.acc-features {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 2.55rem;
}

.acc-feature {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.05rem 1.25rem;
  border-radius: 0.8rem;
  border: 1px solid var(--acc-border);
  background: var(--acc-surface);
  box-shadow: 0 1px 2px rgba(60, 40, 20, 0.04);
}

.acc-feature__icon {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0.55rem;
  border: 1px solid rgba(0, 152, 135, 0.25);
  background: rgba(0, 152, 135, 0.09);
  color: var(--acc-green-dark);
  font-size: 1.05rem;
}

.acc-feature__title {
  display: block;
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--acc-heading);
  margin-top: 0.1rem;
}

.acc-feature__text {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: var(--acc-muted);
}

/* ---------- Bloque institucional ---------- */

.acc-institucional {
  margin-top: 2.1rem;
}

.acc-institucional__logo {
  display: block;
  width: 100%;
  max-width: 22rem;
  height: auto;
}

/* ---------- Tarjeta de acceso ---------- */

.acc-card {
  position: relative;
  padding: 1.9rem 1.85rem 1.75rem;
  border-radius: 1.35rem;
  border: 1px solid var(--acc-border);
  background: #fff;
  box-shadow: 0 30px 60px -28px rgba(60, 40, 20, 0.28), 0 2px 6px rgba(60, 40, 20, 0.05);
}

/* Logo Eco Balam (color) sobre la tarjeta de inicio de sesión */
.acc-card__logo-wrap {
  display: flex;
  justify-content: center;
  margin: -0.35rem 0 1.15rem;
}

.acc-card__logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: 4.75rem;
  object-fit: contain;
}

.acc-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.acc-card__title {
  margin: 0;
  font-family: var(--acc-font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--acc-heading);
}

.acc-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 152, 135, 0.35);
  background: rgba(0, 152, 135, 0.08);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--acc-green-dark);
  white-space: nowrap;
}

.acc-card__sub {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--acc-muted);
}

.acc-form {
  margin-top: 0.3rem;
}

.acc-label {
  display: block;
  margin: 1.45rem 0 0.6rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--acc-heading);
}

.acc-control {
  position: relative;
  display: flex;
  align-items: center;
}

.acc-control__icon {
  position: absolute;
  left: 0.95rem;
  font-size: 1rem;
  color: var(--acc-subtle);
  pointer-events: none;
}

.acc-input {
  width: 100%;
  min-width: 0;
  height: 2.8rem;
  padding: 0 0.95rem 0 2.6rem;
  border-radius: 0.55rem;
  border: 1px solid #d9cdc2;
  background: #fbf9f7;
  color: var(--acc-text);
  font-size: 0.93rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.acc-input::placeholder {
  color: var(--acc-subtle);
  opacity: 1;
}

.acc-input:focus {
  outline: none;
  border-color: var(--acc-green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 152, 135, 0.18);
}

.acc-input.is-invalid {
  border-color: var(--acc-red);
}

.acc-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(174, 25, 45, 0.15);
}

.acc-input--password {
  padding-right: 2.9rem;
}

.acc-eye {
  position: absolute;
  right: 0.45rem;
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--acc-subtle);
  font-size: 1rem;
}

.acc-eye:hover {
  color: var(--acc-text);
}

.acc-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.acc-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--acc-green-dark);
  font-weight: 600;
  text-decoration: none;
}

.acc-link:hover {
  color: var(--acc-green-darker);
  text-decoration: underline;
}

.acc-forgot {
  font-size: 0.84rem;
}

.acc-submit {
  width: 100%;
  height: 2.8rem;
  margin-top: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 0;
  border-radius: 0.6rem;
  background: linear-gradient(90deg, #008577 0%, var(--acc-green-dark) 55%, #006d61 100%);
  color: #fff;
  font-size: 0.93rem;
  font-weight: 600;
  box-shadow: 0 10px 22px -10px rgba(0, 121, 108, 0.65);
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.acc-submit:hover {
  color: #fff;
  filter: brightness(1.08);
}

.acc-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.acc-divider {
  margin: 1.4rem 0 1.2rem;
  border: 0;
  border-top: 1px solid var(--acc-border);
  opacity: 1;
}

.acc-new {
  margin: 0;
  text-align: center;
  font-size: 0.84rem;
  color: #3d3833;
}

.acc-new .acc-link {
  margin-left: 0.15rem;
}

.acc-secondary {
  width: 100%;
  height: 2.5rem;
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 0.6rem;
  border: 1px solid var(--acc-border-strong);
  background: #fff;
  color: var(--acc-text);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.acc-secondary:hover {
  color: var(--acc-heading);
  background: #f6f0ea;
  border-color: #bfae9f;
}

.acc-legal {
  margin: 1.1rem 0 0;
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--acc-muted);
}

.acc-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(174, 25, 45, 0.3);
  background: rgba(174, 25, 45, 0.06);
  color: #8a1424;
  font-size: 0.85rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.acc-alert svg {
  margin-top: 0.12rem;
  color: var(--acc-danger);
}

/* ---------- Modal de recuperación ---------- */

.acc-modal .modal-content {
  border-radius: 1.35rem;
  border: 1px solid var(--acc-border);
  background: #fff;
  color: var(--acc-text);
  box-shadow: 0 30px 60px -20px rgba(60, 40, 20, 0.35);
}

.modal-backdrop.show {
  opacity: 0.45;
}

.acc-modal__header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.5rem 1.6rem 0;
}

.acc-modal__heading {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.acc-modal__eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--acc-muted);
}

.acc-modal__title {
  margin: 0.15rem 0 0;
  font-family: var(--acc-font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--acc-heading);
}

.acc-modal__close {
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--acc-border);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--acc-muted);
  font-size: 1rem;
}

.acc-modal__close:hover {
  color: var(--acc-heading);
  border-color: var(--acc-border-strong);
}

.acc-modal__body {
  padding: 1.2rem 1.6rem 0.5rem;
}

.acc-modal__text {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #2a2622;
}

.acc-modal__text--muted {
  font-size: 0.84rem;
  color: var(--acc-muted);
}

.acc-modal .acc-label {
  margin-top: 1.1rem;
}

.acc-modal__note {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--acc-muted);
}

.acc-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--acc-danger);
}

.acc-error:empty {
  display: none;
}

.acc-modal__loading {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--acc-muted);
}

.acc-modal__loading svg {
  color: var(--acc-green-dark);
}

.acc-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.1rem 1.6rem 1.5rem;
}

.acc-secondary--inline,
.acc-submit--inline {
  width: auto;
  height: 2.6rem;
  margin-top: 0;
  padding: 0 1.15rem;
}

.acc-spin {
  animation: acc-spin 0.9s linear infinite;
}

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

/* ---------- Laptops ---------- */

@media (min-width: 992px) and (max-width: 1199.98px) {
  .acc-shell {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
    grid-template-columns: minmax(0, 1fr) 24rem;
    column-gap: 2.5rem;
  }
}

/* ---------- Tablets y celulares ---------- */

@media (max-width: 991.98px) {
  .acc-shell {
    max-width: 36rem;
    min-height: 0;
    padding: 1.5rem 1.25rem 2rem;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'intro'
      'access'
      'features'
      'institucional';
    grid-template-rows: auto;
    align-content: start;
  }

  .acc-access {
    padding-top: 2rem;
  }

  .acc-headline {
    font-size: clamp(1.75rem, 7vw, 2.3rem);
  }
}

@media (max-width: 575.98px) {
  .acc-shell {
    padding: 1.1rem 1rem 1.5rem;
  }

  .acc-pill {
    margin-top: 1.25rem;
  }

  .acc-lead {
    margin-top: 1.1rem;
    font-size: 0.95rem;
  }

  .acc-access {
    padding-top: 1.5rem;
  }

  .acc-card {
    padding: 1.5rem 1.15rem 1.4rem;
    border-radius: 1.1rem;
  }

  .acc-input {
    height: 2.95rem;
    font-size: 1rem;
  }

  .acc-eye {
    right: 0.15rem;
    width: 2.75rem;
    height: 2.75rem;
  }

  .acc-forgot {
    padding: 0.4rem 0;
  }

  .acc-submit {
    height: 3rem;
  }

  .acc-secondary {
    height: 2.85rem;
  }

  .acc-features {
    margin-top: 2rem;
  }

  .acc-feature {
    padding: 0.9rem 1rem;
    gap: 0.85rem;
  }

  .acc-modal__header {
    padding: 1.25rem 1.15rem 0;
  }

  .acc-modal__close {
    width: 2.75rem;
    height: 2.75rem;
  }

  .acc-modal__body {
    padding: 1rem 1.15rem 0.5rem;
  }

  .acc-modal__footer {
    flex-direction: column-reverse;
    padding: 1rem 1.15rem 1.25rem;
  }

  .acc-secondary--inline,
  .acc-submit--inline {
    width: 100%;
    height: 2.85rem;
  }
}

@media (max-width: 359.98px) {
  .acc-shell {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .acc-headline {
    font-size: 1.6rem;
  }

  .acc-card {
    padding-left: 0.95rem;
    padding-right: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .acc-page *,
  .acc-page *::before,
  .acc-page *::after {
    transition: none !important;
    animation: none !important;
  }
}
