/* Portada pública. La cabecera compartida cambia al entrar en el espacio docente. */
.brand-initials,
.public-signature,
.site-head .head-label:empty {
  display: none;
}

body:has(#access:not([hidden])) {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  background: white;
  color: #183952;
}

#principal:has(#access:not([hidden])) {
  flex: 1;
  display: grid;
}

body:has(#access:not([hidden])) .head-in,
body:has(#access:not([hidden])) .foot-in {
  width: min(89%, 1500px);
}

body:has(#access:not([hidden])) .head-in {
  min-height: 94px;
  padding-block: 12px;
}

body:has(#access:not([hidden])) .brand { gap: 18px; }
body:has(#access:not([hidden])) .brand img {
  width: 48px;
  height: 48px;
  border-radius: 11px;
}

body:has(#access:not([hidden])) .brand-initials {
  display: block;
  color: #194865;
  font-size: 28px;
  letter-spacing: -.055em;
}

body:has(#access:not([hidden])) .brand strong {
  border-left: 1px solid #cddce5;
  padding-left: 18px;
  font-size: 17px;
  color: #183952;
  letter-spacing: 0;
}

body:has(#access:not([hidden])) .brand span { display: none; }
body:has(#access:not([hidden])) .public-signature {
  display: block;
  color: #567080;
  font-size: 17px;
}

.access-grid.frame {
  width: min(100%, 1600px);
  min-height: max(550px, calc(100svh - 164px));
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 32px;
  padding: 39px max(4.6%, 28px);
}

.welcome-family {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 29px;
  background: #e3f1fb;
  text-align: center;
}

.welcome-family::before,
.welcome-family::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.welcome-family::before {
  width: 1100px;
  height: 650px;
  left: -585px;
  bottom: -525px;
  transform: rotate(-18deg);
  background: #d4e9f8;
  box-shadow: 0 -21px 0 #dbedf9;
}

.welcome-family::after {
  width: 530px;
  height: 530px;
  right: -420px;
  top: -357px;
  background: #d6e9f7;
  box-shadow: 0 0 0 24px #dceefa;
}

.welcome-message {
  width: 90%;
  padding-block: 24px 20px;
}

#intro-title {
  margin: 0;
  color: #183e59;
  font-size: clamp(46px, 4.2vw, 66px);
  line-height: 1.07;
  letter-spacing: -.045em;
}

#access .welcome-intro {
  max-width: 465px;
  margin: 23px auto 0;
  color: #345771;
  font-size: 23px;
  line-height: 1.5;
  letter-spacing: -.024em;
  text-align: center;
  text-align-last: center;
  text-wrap: balance;
}

.welcome-art {
  display: block;
  width: auto;
  height: clamp(156px, 28svh, 240px);
  margin: 22px auto 0;
}

#access .login-card {
  align-self: center;
  justify-self: center;
  width: min(84%, 420px);
  min-width: 0;
  margin: 0;
  padding: 12px 0;
  background: white;
  color: #183952;
  border: 0;
  box-shadow: none;
}

#auth-title {
  margin: 0;
  color: #183b54;
  font-weight: 700;
  font-size: 44px;
  line-height: 1.18;
  letter-spacing: -.04em;
}

#auth-hint {
  margin: 10px 0 24px;
  color: #52697a;
  font-size: 18px;
  text-align: center;
  text-align-last: center;
  text-wrap: balance;
}

#provider-options {
  --google-scale: 1.65;
  display: grid;
  gap: 14px;
  margin-top: 33px;
}

/* El SDK mide y valida el control antes de mostrarlo. Sólo ampliamos
   el botón ya cargado para que su área táctil también crezca. */
#google-login {
  width: calc(100% / var(--google-scale));
  height: calc(40px * var(--google-scale));
  overflow: visible;
}

#google-login > div:not(.google-pending) {
  transform: scale(var(--google-scale));
  transform-origin: top left;
}

#use-email, #auth-submit {
  min-height: 54px;
  border-radius: 14px;
  color: white;
  background: #23577e;
  border-color: #23577e;
  font-size: 18px;
}

#use-email {
  margin: 0;
  min-height: calc(40px * var(--google-scale));
  gap: 14px;
  font-size: 20px;
}

#use-email:hover, #auth-submit:not(:disabled):hover { background: #1c4665; }
.login-card .auth-switch {
  margin-top: 29px;
  padding-top: 19px;
  border-color: #e1e8ee;
  font-size: 17px;
  color: #536b7d;
}

.auth-switch .plain {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-left: 4px;
  color: #23577e;
  font-weight: 700;
  text-underline-offset: 4px;
}

.site-foot .foot-in {
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-block: 10px;
}

body:has(#access:not([hidden])) .foot-in {
  min-height: 70px;
  font-size: 14px;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 18px;
}

.footer-links :is(.plain, .access-privacy-link) {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0;
  padding: 0;
  font: inherit;
  color: var(--ruta-muted);
  text-underline-offset: .18em;
}

@media (max-width: 1030px) {
  .access-grid.frame { padding-inline: 24px; gap: 24px; }
  #access .login-card { width: min(98%, 420px); }
  #provider-options { --google-scale: 1.35; }
}

@media (max-width: 740px) {
  body:has(#access:not([hidden])) .head-in {
    width: calc(100% - 32px);
    min-height: 64px;
    padding-block: 8px;
  }

  body:has(#access:not([hidden])) .brand { gap: 10px; }
  body:has(#access:not([hidden])) .brand img { width: 40px; height: 40px; }
  body:has(#access:not([hidden])) .brand-initials,
  body:has(#access:not([hidden])) .public-signature { display: none; }
  body:has(#access:not([hidden])) .brand strong { border: 0; padding: 0; font-size: 16px; }
  body:has(#access:not([hidden])) .brand span { display: block; color: #567080; }

  .access-grid.frame {
    width: min(calc(100% - 28px), 530px);
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: 22px;
    padding: 14px 0 24px;
  }

  .welcome-family { border-radius: 20px; }
  .welcome-family::before { width: 420px; height: 180px; left: -200px; bottom: -150px; }
  .welcome-family::after { width: 210px; height: 210px; right: -165px; top: -154px; }
  .welcome-message { width: 92%; padding: 14px 0 10px; }
  #intro-title { font-size: clamp(25px, 6.1vw, 32px); }
  #intro-title br { display: none; }
  #access .welcome-intro { max-width: 35ch; margin-top: 8px; font-size: 16px; line-height: 1.35; }
  .welcome-art { height: 104px; margin-top: 7px; }
  #access .login-card { width: min(100% - 16px, 400px); padding: 0; }
  #auth-title { font-size: 32px; }
  #auth-hint { margin: 6px 0 14px; font-size: 16px; }
  #provider-options { --google-scale: 1.2; margin-top: 16px; gap: 10px; }
  #use-email { font-size: 17px; }
  .login-card .auth-switch { margin-top: 18px; padding-top: 10px; font-size: 16px; }

  .site-foot .foot-in, .footer-links, .foot-in .foot-brand { justify-content: center; }
  .foot-in .foot-brand { width: 100%; }
  .footer-links { column-gap: 14px; }
}
