/* Login / register - vertical blue wash, glass card, poster */

html[data-title-key="meta.login"],
html[data-title-key="meta.register"] {
  background: #000;
}

body.auth-refresh {
  min-height: 100vh;
  min-height: 100dvh;
  color: #122348;
  background: linear-gradient(
    180deg,
    #e7f0fe 0%,
    #c9d9ff 8%,
    #a7c3fe 18%,
    #78a1fe 32%,
    #4b7cfe 46%,
    #2b5bef 56%,
    #173898 68%,
    #091a52 78%,
    #020712 88%,
    #000000 96%
  );
}

body.auth-refresh .bg-mesh {
  display: none;
}

.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0;
  padding: 22px 15px 22px 0;
}

body.auth-refresh:has(.cookie-bar) .gate {
  padding-bottom: 128px;
}

.gate-form {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
}

.glass {
  width: min(460px, 100%);
  max-height: calc(100dvh - 44px);
  overflow: auto;
  padding: 32px 32px 26px;
  border-radius: 30px;
  color: #122348;
  font-size: 16px;
  line-height: 1.45;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.84));
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -18px 40px rgba(255, 255, 255, 0.12),
    0 24px 60px rgba(6, 16, 48, 0.28);
  backdrop-filter: blur(26px) saturate(1.45);
  -webkit-backdrop-filter: blur(26px) saturate(1.45);
  scrollbar-width: thin;
  scrollbar-color: rgba(18, 35, 72, 0.28) transparent;
}

.gate-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 22px;
  color: #101b38;
}

.gate-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(37, 84, 220, 0.28));
}

.gate-brand span {
  font-family: "Dela Gothic One", Inter, sans-serif;
  font-size: 1.85rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
}

.glass h1 {
  margin: 0;
  font-family: "Dela Gothic One", Inter, sans-serif;
  font-size: 1.72rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-align: center;
  color: #101b38;
}

.glass .lead {
  margin: 8px 0 20px;
  text-align: center;
  color: #243656;
  font-size: 0.95rem;
}

.glass form {
  display: grid;
  gap: 12px;
}

.glass .label-row {
  color: #122348;
  font-size: 0.78rem;
}

.glass .hint,
.glass .auth-switch,
.glass .auth-verify-note,
.glass .export-note {
  color: #243656;
}

.glass .field input {
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.72);
  color: #102044;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(20, 40, 90, 0.05);
}

.glass .field input::placeholder {
  color: rgba(18, 35, 72, 0.55);
}

.glass .field input:focus {
  border-color: rgba(50, 100, 240, 0.7);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(50, 100, 240, 0.16);
}

.glass .field input:-webkit-autofill {
  -webkit-text-fill-color: #102044;
  caret-color: #102044;
  box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.92) inset;
}

.glass .linkish,
.glass .auth-switch a,
.glass .consent a {
  color: #2450e8;
}

.glass .auth-error {
  color: #b42318;
  min-height: 0;
  margin: 0;
}

.glass .auth-error:empty {
  display: none;
}

.glass .auth-switch {
  margin: 16px 0 0;
}

.glass .btn-primary {
  border-radius: 16px;
  min-height: 52px;
}

.glass .btn-ghost {
  color: #16315f;
  background: rgba(255, 255, 255, 0.38);
  border-color: rgba(16, 40, 90, 0.14);
  border-radius: 16px;
}

.glass .btn-ghost:hover:not(:disabled) {
  color: #0e1b3d;
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(50, 100, 240, 0.35);
}

.btn-google {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 4px;
  border-radius: 16px;
  border: 1px solid rgba(16, 32, 68, 0.1);
  background: #fff;
  color: #1f1f1f;
  font-weight: 600;
  font-size: 0.98rem;
  box-shadow: 0 10px 22px rgba(16, 32, 68, 0.08);
}

.btn-google:hover {
  background: #f6f8ff;
}

.btn-google svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.gate-or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 2px 0 2px;
  color: #3a4e74;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gate-or::before,
.gate-or::after {
  content: "";
  height: 1px;
  background: rgba(16, 32, 68, 0.16);
}

.pw-meter {
  display: grid;
  gap: 7px;
  margin-top: -2px;
}

.pw-meter-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1c3058;
}

.pw-track {
  height: 7px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(16, 32, 68, 0.12);
}

.pw-track > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: rgba(16, 32, 68, 0.2);
  transition: width 0.25s ease, background 0.25s ease;
}

.pw-meter.is-weak .pw-track > span { width: 28%; background: #e11d48; }
.pw-meter.is-ok .pw-track > span { width: 58%; background: #d97706; }
.pw-meter.is-good .pw-track > span { width: 80%; background: #3264f0; }
.pw-meter.is-strong .pw-track > span { width: 100%; background: #16a34a; }

.pw-meter.is-weak .pw-meter-label { color: #be123c; }
.pw-meter.is-ok .pw-meter-label { color: #b45309; }
.pw-meter.is-good .pw-meter-label { color: #1d4ed8; }
.pw-meter.is-strong .pw-meter-label { color: #15803d; }

.pw-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pw-rules li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #243656;
  font-size: 0.78rem;
  font-weight: 600;
}

.pw-rules li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.85;
}

.pw-rules li.is-met {
  color: #15803d;
}

.pw-rules li.is-met::before {
  opacity: 1;
}

.consents {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.consent {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  cursor: pointer;
  color: #122348;
  font-size: 0.92rem;
  line-height: 1.35;
}

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

.consent:has(input:focus-visible) {
  outline: 2px solid #2450e8;
  outline-offset: 4px;
  border-radius: 12px;
}

.consent-mark {
  width: 36px;
  height: 36px;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.consent-mark [data-check] {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 104px;
  height: 104px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.consent-mark svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.consent a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.glass .auth-code {
  letter-spacing: 0.28em;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.gate-art {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.gate-art img {
  height: calc(100dvh - 44px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 28px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

@media (max-width: 980px) {
  .gate {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 16px;
    gap: 16px;
  }

  .gate-art {
    display: none;
  }

  .glass {
    max-height: none;
    padding: 26px 20px 22px;
  }

  .gate-form {
    padding: 0;
  }
}

@media (max-width: 520px) {
  .gate-brand span {
    font-size: 1.5rem;
  }

  .glass h1 {
    font-size: 1.45rem;
  }
}

/* Google sign-in block (hidden until /api/auth/google/config says it is set up) */
.google-block { display: grid; gap: 10px; }
.google-block[hidden] { display: none; }
.google-consent { margin: 0; color: #5a6b8c; font-size: 0.78rem; line-height: 1.5; text-align: center; }
.google-consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.btn-google:disabled { opacity: .6; cursor: progress; }
