/* The homepage uses the application's authentication controller without
   importing the application's entire stylesheet. Keep this surface visually
   aligned with css/style.css's sign-in section. */

#auth-pop[hidden], #auth-signin[hidden], #wizard[hidden],
#email-alt[hidden], #email-step-send[hidden], #email-step-verify[hidden],
#invite-ok[hidden] { display: none !important; }

body.modal-open { overflow: hidden; }

#auth-pop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 20, 0.45);
  opacity: 0;
  transition: opacity .2s ease;
  will-change: opacity;
}

#auth-pop.open { opacity: 1; transition-duration: 1s; }

.auth-card {
  position: relative;
  width: min(92vw, 380px);
  max-height: min(86vh, 720px);
  overflow-y: auto;
  background: var(--bg, #f9f9f9);
  border-radius: 16px;
  padding: 2rem 2.2rem 1.8rem;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.auth-title { font-size: 1.05rem; margin: 0 0 1rem; }
.auth-note { font-size: .8rem; color: var(--muted, #7f7f7f); font-style: italic; margin: 0; }
.auth-note.quiet { color: var(--green, #2a7f00); font-size: .78rem; }

#auth-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: none;
  color: var(--muted, #7f7f7f);
  font-size: .95rem;
  cursor: pointer;
}

#invite-gate {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  align-items: center;
  margin: .6rem 0 .8rem;
}

#invite-gate input, #email-alt input {
  width: 100%;
  padding: .5rem .8rem;
  border: 1px solid var(--line, #e1e1e1);
  border-radius: 999px;
  background: #fff;
  color: var(--ink, #1a1a1a);
  font: inherit;
}

#invite-gate input { text-align: center; letter-spacing: .08em; }
#email-alt input { margin-bottom: .45rem; border-radius: 6px; font-size: .88rem; }

.btn {
  padding: .45rem .95rem;
  border: 1px solid var(--line, #e1e1e1);
  background: transparent;
  color: var(--ink, #1a1a1a);
  border-radius: 999px;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

.btn:hover { border-color: var(--ink, #1a1a1a); }
.btn.small { padding: .3rem .7rem; font-size: .8rem; }
.btn.solid { background: var(--ink, #1a1a1a); border-color: var(--ink, #1a1a1a); color: var(--bg, #f9f9f9); }
.btn:disabled { cursor: default; opacity: .55; }

.auth-or {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--muted, #7f7f7f);
  font-size: .78rem;
  margin: .9rem 0 .6rem;
}

.auth-or::before, .auth-or::after,
.auth-sec-line::before, .auth-sec-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line, #e1e1e1);
}

.auth-sec {
  font-size: .8rem;
  letter-spacing: .02em;
  color: var(--muted, #7f7f7f);
  margin: 0 0 .35rem;
}

.auth-sec-line {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 1.4rem 0 .75rem;
  text-align: center;
  white-space: nowrap;
}

#invite-gate .auth-sec-line { margin-top: .2rem; align-self: stretch; }

#gsi-button {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.2rem 0;
  min-height: 44px;
}

#gsi-button:empty::before {
  content: '';
  display: block;
  width: 218px;
  height: 40px;
  border: 1px solid var(--line, #e1e1e1);
  border-radius: 999px;
  opacity: .4;
}

.wz-error { color: #b3261e; font-size: .82rem; min-height: 1.1em; margin: .6rem 0 0; }

#demo-view-btn.demo-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  margin-top: .2rem;
  padding: .55rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--blue, #0000f6);
  color: #fff;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 246, .28);
  transition: background .15s, box-shadow .15s, transform .15s;
}

#demo-view-btn.demo-cta:hover { background: #0000c4; box-shadow: 0 4px 16px rgba(0, 0, 246, .38); }
#demo-view-btn.demo-cta:active { transform: translateY(1px); }
#demo-view-btn.demo-cta .dc-star { font-size: .72rem; opacity: .85; animation: dc-twinkle 2.4s ease-in-out infinite; }
#demo-view-btn.demo-cta .dc-star:last-child { animation-delay: 1.2s; }

@keyframes dc-twinkle {
  0%, 100% { opacity: .45; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

@media (max-width: 720px) {
  .auth-card { width: min(94vw, 420px); padding: 1.4rem 1.2rem; }
  #invite-gate input, #email-alt input { font-size: 16px; }
  .btn, .ghost-btn { min-height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  #auth-pop { transition: none; }
  #demo-view-btn.demo-cta .dc-star { animation: none; opacity: .85; }
}
