/* BUILD v4 - sign in / create account page */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Top-left brand ---------- */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  padding: clamp(16px, 3vw, 28px) clamp(18px, 3.5vw, 36px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: auto;
  filter: drop-shadow(0 6px 16px rgba(20, 80, 240, 0.55));
}

.brand span {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand:focus-visible {
  outline: 2px solid var(--sky-200);
  outline-offset: 6px;
  border-radius: 10px;
}

/* ---------- Layout ---------- */
.auth-main {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(96px, 16vh, 150px) 20px 64px;
}

.mode-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Tabs (Sign In + shiny Create account) ---------- */
.tabs {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.tabs .shiny-cta { margin-top: 0; }

.tab {
  display: inline-block;
  padding: 1.25rem 2.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 360px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.14);
}

#mode-signin:checked ~ .tabs .tab {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 34px rgba(77, 134, 255, 0.45);
}

/* Create account tab: shiny effect stays "on" while it is the active mode */
#mode-create:checked ~ .tabs .shiny-cta {
  --gradient-percent: 20%;
  --gradient-angle-offset: 95deg;
  --gradient-shine: var(--shiny-cta-highlight-subtle);
}
#mode-create:checked ~ .tabs .shiny-cta,
#mode-create:checked ~ .tabs .shiny-cta::before,
#mode-create:checked ~ .tabs .shiny-cta::after {
  animation-play-state: running;
}
#mode-create:checked ~ .tabs .shiny-cta span::before {
  opacity: 1;
}

#mode-signin:focus-visible ~ .tabs label[for="mode-signin"],
#mode-create:focus-visible ~ .tabs label[for="mode-create"] {
  outline: 2px solid var(--sky-200);
  outline-offset: 4px;
}

/* ---------- Panels (swap by mode) ---------- */
.panel {
  display: none;
  width: 100%;
  max-width: 400px;
  margin-top: clamp(28px, 5vh, 44px);
}

#mode-signin:checked ~ .panel-signin,
#mode-create:checked ~ .panel-create {
  display: block;
  animation: panel-in 0.35s ease both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Inputs (sit directly on the page, no card) ---------- */
.field {
  margin-bottom: 16px;
  text-align: left;
}

.field label {
  display: block;
  margin: 0 0 7px 4px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.field input {
  width: 100%;
  padding: 15px 18px;
  font: inherit;
  font-size: 1rem; /* 16px+ stops iOS zooming on focus */
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  outline: none;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(188, 212, 255, 0.85);
  box-shadow: 0 0 0 4px rgba(77, 134, 255, 0.25);
}

.field input:user-invalid {
  border-color: rgba(255, 130, 150, 0.85);
}

.field input:-webkit-autofill {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px rgba(20, 45, 140, 0.9) inset;
}

.hint {
  margin: 7px 4px 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: rgba(232, 240, 255, 0.55);
}

.hint-center {
  margin: 0 0 22px;
  text-align: center;
}

/* ---------- Profile picture picker ---------- */
.avatar {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  width: 96px;
  height: 96px;
  margin: 0 auto 10px;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.avatar:hover,
.avatar:focus-within {
  border-color: rgba(188, 212, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(77, 134, 255, 0.25);
}

.avatar input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.avatar-plus {
  font-size: 1.9rem;
  line-height: 1;
  color: var(--sky-200);
}

.avatar-text {
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.avatar.has-photo { border-style: solid; }

.avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Submit ---------- */
.submit {
  width: 100%;
  margin-top: 8px;
  padding: 17px 24px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--navy-950);
  background: #fff;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 34px rgba(77, 134, 255, 0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 44px rgba(77, 134, 255, 0.65);
}

.submit:active { transform: translateY(0); }

.submit:focus-visible {
  outline: 2px solid var(--sky-200);
  outline-offset: 4px;
}

.aux {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.9rem;
}

.aux a {
  color: var(--sky-200);
  text-underline-offset: 3px;
}

/* Bot trap: invisible to people, tempting to bots */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .tabs { width: 100%; flex-wrap: nowrap; }
  .tab,
  .tabs .shiny-cta {
    flex: 1 1 0;
    padding: 1rem 0.6rem;
    font-size: 1rem;
    text-align: center;
  }
  .brand span { font-size: 1.05rem; }
  .brand img { width: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .panel { animation: none !important; }
  .tab, .field input, .submit, .avatar { transition: none; }
}
