/* ═══════════════════════════════════════════════════════════
   PUBLIC-WEBSITE LOGIN GATE (Telegram OAuth, /diy)
   Selected Courage Garage identity; scoped to the signed-out page.
   ═══════════════════════════════════════════════════════════ */
.web-login-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--cg-paper);
  color: var(--cg-ink);
  font-family: var(--cg-font-body);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.web-login-gate[hidden] { display: none; }
/* Lock background scroll while the gate is up. */
body.web-login-active { overflow: hidden; }
body.web-login-active #app-root { display: none; }

.web-login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  min-height: 100%;
}
/* Position only; the shared cg-field owns the control's appearance. */
.web-login-language {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  z-index: 2;
  max-width: 140px;
}
.web-login-story {
  min-height: 42rem;
}
.web-login-photo {
  position: absolute;
  inset: 0;
  height: 100%;
  object-position: 62% 42%;
}
.web-login-story .web-login-caption {
  position: absolute;
  top: auto;
  bottom: max(2.5rem, env(safe-area-inset-bottom));
  left: max(2.5rem, env(safe-area-inset-left));
  max-width: calc(100% - 5rem);
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--cg-red);
}
.web-login-panel {
  display: flex;
  align-items: center;
  padding: 4rem clamp(2.5rem, 5vw, 6rem);
  border-left: 6px solid var(--cg-red);
  min-width: 0;
}
.web-login-content {
  width: 100%;
  max-width: 26rem;
  margin: auto;
}
.web-login-eyebrow {
  margin: 0 0 1.75rem;
  font-family: var(--cg-font-label);
  font-size: 0.75rem;
  line-height: 1.6;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.web-login-title {
  margin: 0 0 2.75rem;
  line-height: 1;
}
.web-login-wordmark {
  width: 100%;
  max-width: 23rem;
}
.web-login-welcome {
  margin: 0 0 0.875rem;
  font-family: var(--cg-font-body);
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.2;
  text-transform: none;
  color: var(--cg-ink);
}
.web-login-sub {
  max-width: 23rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  margin: 0 0 2rem;
}
.web-login-gate .tg-login-btn { width: 100%; }
.web-login-err {
  color: var(--cg-red);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 1rem 0 0;
}
.web-login-err[hidden] { display: none; }
.web-login-legal {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--cg-muted);
  margin: 0.75rem 0 0;
}
.web-login-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.web-login-hint {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--cg-ink);
  margin: 1rem 0 0;
}

@media (max-width: 899px) {
  .web-login-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: max-content 1fr;
  }
  .web-login-story {
    height: clamp(11rem, 27svh, 17rem);
    min-height: 0;
  }
  .web-login-photo { object-position: 50% 48%; }
  .web-login-story .web-login-caption { display: none; }
  .web-login-panel {
    padding: 1.75rem max(1.5rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
    border-left: 0;
    border-top: 5px solid var(--cg-red);
  }
  .web-login-content { max-width: 30rem; }
  .web-login-eyebrow { margin-bottom: 1rem; }
  .web-login-title { margin-bottom: 1.5rem; }
  .web-login-wordmark { width: min(62vw, 15rem); }
  .web-login-welcome { font-size: 1.5rem; }
  .web-login-sub {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
  }
  .web-login-hint { margin-top: 0.75rem; }
}

@media (max-width: 899px) and (max-height: 700px) {
  .web-login-story { height: 9rem; }
  .web-login-panel { padding-top: 1.25rem; }
  .web-login-eyebrow { margin-bottom: 0.75rem; }
  .web-login-wordmark { max-width: 12rem; }
  .web-login-title { margin-bottom: 1.25rem; }
}
