/* Guest portal — "Kirill's Guest Wi-Fi".
   Same tokens as the rest of the portal (portal.css); the hero is an
   animated signal bloom instead of a photo. */

/* Hero: drifting colour, rings of signal ----------------------------- */

.hero {
  height: 230px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #dfe9e7 0%, #ece9df 70%, var(--card) 100%);
}
.hero__blob {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(46px);
  opacity: .75;
  will-change: transform;
}
.hero__blob--a {
  left: -80px; top: -120px;
  background: radial-gradient(circle at 40% 40%, #9fc7cc 0%, rgba(159, 199, 204, 0) 70%);
  animation: driftA 22s ease-in-out infinite alternate;
}
.hero__blob--b {
  right: -110px; top: -40px;
  background: radial-gradient(circle at 60% 50%, #e9d3b8 0%, rgba(233, 211, 184, 0) 70%);
  animation: driftB 27s ease-in-out infinite alternate;
}
@keyframes driftA { from { transform: translate(0, 0) scale(1); } to { transform: translate(90px, 50px) scale(1.15); } }
@keyframes driftB { from { transform: translate(0, 0) scale(1.05); } to { transform: translate(-110px, 40px) scale(.9); } }

.hero__signal {
  position: absolute;
  left: 50%; top: 50%;
  width: 300px; height: 300px;
  transform: translate(-50%, -46%);
}
.signal__ring {
  stroke: var(--accent);
  stroke-width: 1.2;
  transform-origin: 200px 200px;
  opacity: 0;
  animation: ring 7s cubic-bezier(.2, .6, .3, 1) infinite;
}
.signal__ring:nth-child(2) { animation-delay: 1.75s; }
.signal__ring:nth-child(3) { animation-delay: 3.5s; }
.signal__ring:nth-child(4) { animation-delay: 5.25s; }
@keyframes ring {
  0%   { transform: scale(.35); opacity: 0; }
  12%  { opacity: .55; }
  100% { transform: scale(6.2); opacity: 0; }
}
.signal__core {
  fill: var(--accent);
  transform-origin: 200px 200px;
  animation: breathe 3.5s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
.signal__star {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: .8;
  transform-origin: 200px 172px;
  animation: twinkle 9s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: .9; transform: rotate(0deg) scale(1); }
  50% { opacity: .5; transform: rotate(180deg) scale(.8); }
}
.hero__fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(247, 243, 234, 0) 55%, #f7f3ea 100%);
}

/* Short phones and the on-screen keyboard: collapse the hero so the code
   cells stay above the keyboard (see keyboardWatch in js/portal.js). */
@media (max-height: 640px) { .hero { height: 150px; } }
@media (max-width: 959.98px) {
  .hero { transition: height .2s ease; }
  .card.is-typing .hero { height: 96px; }
  .card.is-typing .lead { display: none; }
  .card.is-typing .title { font-size: 26px; }
}

/* Entry column: content rises into place on load --------------------- */

.entry {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 10px 32px 24px;
}
.entry > * { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
.entry > :nth-child(1) { animation-delay: .05s; }
.entry > :nth-child(2) { animation-delay: .12s; }
.entry > :nth-child(3) { animation-delay: .19s; }
.entry > :nth-child(4) { animation-delay: .28s; }
.entry > :nth-child(5) { animation-delay: .34s; }
.entry > :nth-child(n+6) { animation-delay: .45s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Code cells --------------------------------------------------------- */

.code {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 24px;
  cursor: text;
}
.code__cell {
  width: 42px;
  height: 54px;
  border: 1.5px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 22px var(--mono);
  color: var(--ink);
  transition: border-color .12s ease, color .12s ease, background .12s ease, box-shadow .12s ease;
}
.code__cell.is-filled { border-color: var(--line); }
.code__cell.is-active {
  border: 2px solid var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px rgba(58, 125, 140, .12);
}
.code__dash { font: 600 20px var(--mono); color: var(--line); }
.code__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 22px;      /* keeps iOS from zooming on focus */
  border: 0;
  padding: 0;
  margin: 0;
  color: transparent;
  caret-color: transparent;
  background: transparent;
}

.code.is-error .code__cell {
  border: 1.5px solid var(--err-line);
  background: var(--err-tint);
  color: var(--err);
  box-shadow: none;
}
.code.is-error .code__dash { color: var(--err-line); }
.code.is-busy .code__cell { opacity: .7; }

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  background: var(--err-tint);
  border: 1px solid var(--err-line-soft);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 22px;
}
.alert__icon { font: 700 13px var(--sans); color: var(--err); }
.alert__text { font: 400 13.5px/1.45 var(--sans); color: var(--err-text); }

.terms u { text-decoration: underline; cursor: pointer; }

/* Success / expired backdrop ----------------------------------------- */

.bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bg .hero__blob { opacity: .55; }
.bg .hero__blob--a { left: -60px; top: -60px; }
.bg .hero__blob--b { right: -80px; bottom: -80px; top: auto; }
.screen--center > :not(.bg) { position: relative; animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
.screen--center > :nth-child(3) { animation-delay: .08s; }
.screen--center > :nth-child(4) { animation-delay: .16s; }
.screen--center > :nth-child(5) { animation-delay: .26s; }
.screen--center > :nth-child(6) { animation-delay: .34s; }

/* Desktop: signal on the left, form on the right ---------------------- */

@media (min-width: 960px) {
  #screen-entry { flex-direction: row; }
  .hero {
    height: auto;
    width: 46%;
    flex: none;
    background: linear-gradient(90deg, #dfe9e7 0%, #ece9df 70%, var(--card) 100%);
  }
  .hero__blob { width: 520px; height: 520px; filter: blur(70px); }
  .hero__blob--a { left: -120px; top: -140px; }
  .hero__blob--b { right: -160px; top: auto; bottom: -160px; }
  .hero__signal { width: 520px; height: 520px; transform: translate(-50%, -50%); }
  .hero__fade { background: linear-gradient(90deg, rgba(247, 243, 234, 0) 70%, #f7f3ea 100%); }

  .entry {
    max-width: none;
    margin: 0;
    justify-content: center;
    padding: 48px clamp(32px, 5vw, 64px);
  }
  .entry .eyebrow { font-size: 13px; letter-spacing: 2.5px; }
  .entry .title { font-size: 46px; line-height: 1.1; margin-top: 14px; }
  .entry .lead { font-size: 16px; margin-top: 12px; }
  .entry .spacer { flex: 0; }

  .code { gap: 10px; margin-top: 34px; }
  .code__cell { width: 52px; height: 66px; border-radius: 12px; font-size: 27px; }
  .code__dash { font-size: 24px; }
  .code__input { font-size: 27px; }
  #entry-hint { font-size: 13px; margin-top: 16px; }
  .terms { font-size: 13px; margin-top: 30px; }

  .alert { max-width: 420px; padding: 14px 18px; margin-top: 26px; }
  .alert__icon { font-size: 14px; }
  .alert__text { font-size: 14.5px; }
  .code.is-error ~ .hr-short { margin: 26px 0; }


  /* success / expired */
  .screen--center { padding: 48px; }
  .screen--center .eyebrow { font-size: 13px; letter-spacing: 2.5px; }
  .title--xl { font-size: 62px; margin-top: 16px; }
  .title--lg { font-size: 52px; line-height: 1.1; margin-top: 16px; }
  #screen-success .lead--lg { font-size: 17px; margin-top: 16px; }
  #screen-expired .lead--lg { font-size: 16px; }
  .screen--center .btn--primary { width: 460px; max-width: 100%; padding: 17px 20px; font-size: 17px; margin-top: 40px; }
  .screen--center .note { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__blob, .signal__ring, .signal__core, .signal__star { animation: none; }
  .signal__ring { opacity: .25; transform: scale(2); }
  .signal__ring:nth-child(2) { transform: scale(3.5); opacity: .18; }
  .signal__ring:nth-child(3) { transform: scale(5); opacity: .1; }
  .signal__ring:nth-child(4) { display: none; }
}
