/* CB-IA-AUTH — Google / YouTube sign-in chrome (clean-room).
   Live scrape 2026-08-14 accounts.google.com GlifWebSignIn @1440:
   card 1040×402 r28, h1 36/400 #1f1f1f, field outline 56 r4, Next 40 r20 #0b57d0.
   Keep host IDs: #authBox #loginForm #regForm #forgotForm #l_email #loginBtn. */

.auth-modal {
  background: #f0f4f9 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px 16px !important;
  cursor: default !important;
  animation: none !important;
  z-index: 5000 !important;
  overflow-y: auto !important;
}

.auth-box {
  width: min(1040px, calc(100vw - 32px)) !important;
  max-width: 1040px !important;
  min-height: 402px !important;
  height: auto !important;
  padding: 36px 40px 36px !important;
  border-radius: 28px !important;
  border: 0 !important;
  background: #fff !important;
  color: #1f1f1f !important;
  box-shadow: none !important;
  animation: none !important;
  overflow: visible !important;
  max-height: none !important;
}
.auth-box::before { display: none !important; }

.auth-box .auth-close {
  top: 12px !important;
  right: 12px !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  color: #444746 !important;
  font-size: 22px !important;
  background: transparent !important;
  z-index: 2 !important;
}
.auth-box .auth-close:hover {
  background: rgba(60, 64, 67, .08) !important;
  color: #1f1f1f !important;
}

/* Never grid-all-forms — host hides siblings with display:none.
   display:grid !important on every form inflated the card to ~2000px. */
.auth-box form {
  display: none !important;
}
.auth-box form.is-active,
.auth-box #loginForm:not([style*="none"]),
.auth-box #regForm[style*="block"],
.auth-box #forgotForm[style*="block"] {
  display: grid !important;
  grid-template-columns: minmax(240px, 1fr) 456px;
  column-gap: 48px;
  row-gap: 0;
  align-items: start;
  grid-auto-flow: dense;
}
.auth-box .cb-ia-auth-left {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.auth-box .cb-ia-auth-right {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#loginForm .cb-ia-auth-right { padding-top: 52px; }

.cb-ia-auth-brand {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0 !important;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: #0f0f0f;
  line-height: 28px;
}
.cb-ia-auth-brand .cb-ia-yt-mark {
  width: 40px;
  height: 28px;
  border-radius: 6px;
  background: #e8a317;
  position: relative;
  flex: 0 0 40px;
}
.cb-ia-auth-brand .cb-ia-yt-mark::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 7px;
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent #fff;
}
.cb-ia-auth-brand .cb-ia-auth-bi {
  color: #e8a317;
}

.auth-box h2,
.auth-box #authTitle {
  text-align: left !important;
  font-size: 36px !important;
  font-weight: 400 !important;
  line-height: 44px !important;
  letter-spacing: 0 !important;
  color: #1f1f1f !important;
  margin: 20px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.auth-box .auth-subtitle {
  text-align: left !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 24px !important;
  color: #1f1f1f !important;
  margin: 16px 0 0 !important;
}

.auth-box .oauth-buttons.oauth-grid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 28px 0 0 !important;
  height: 40px !important;
  width: auto !important;
  max-width: none !important;
}
.auth-box .oauth-btn {
  flex: 0 0 40px !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  padding: 0 !important;
  border-radius: 20px !important;
  border: 1px solid #747775 !important;
  background: #fff !important;
  box-shadow: none !important;
  transform: none !important;
}
.auth-box .oauth-btn:hover {
  background: #f8fafd !important;
  border-color: #0b57d0 !important;
  transform: none !important;
}
.auth-box .oauth-divider {
  display: none !important;
}

.auth-box .form-group {
  margin: 16px 0 0 !important;
  position: relative !important;
}
.auth-box #regForm .form-group,
.auth-box #forgotForm .form-group {
  margin: 12px 0 0 !important;
}
.auth-box .form-group label {
  position: absolute !important;
  left: 12px !important;
  top: 16px !important;
  padding: 0 4px !important;
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 20px !important;
  color: #444746 !important;
  background: #fff !important;
  pointer-events: none !important;
  transform-origin: left center;
  transition: transform .15s ease, font-size .15s ease, color .15s ease, top .15s ease;
  z-index: 1;
}
.auth-box .form-group.is-filled label,
.auth-box .form-group:focus-within label {
  top: -8px !important;
  font-size: 12px !important;
  color: #0b57d0 !important;
}
.auth-box .form-control,
.auth-box select.form-control {
  width: 100% !important;
  height: 56px !important;
  min-height: 56px !important;
  padding: 13px 15px !important;
  border: 1px solid #747775 !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: #1f1f1f !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  box-shadow: none !important;
  outline: none !important;
}
.auth-box .form-control::placeholder {
  color: transparent !important;
}
.auth-box .form-control::-webkit-input-placeholder { color: transparent !important; }
.auth-box .form-control::-moz-placeholder { color: transparent !important; opacity: 0 !important; }
.auth-box .form-group:focus-within .form-control {
  border-color: #0b57d0 !important;
  border-width: 2px !important;
  padding: 12px 14px !important;
}
.auth-box .code-row {
  display: flex !important;
  gap: 12px !important;
  align-items: stretch !important;
}
.auth-box .code-row .form-control { flex: 1 1 auto !important; }
.auth-box .captcha-img {
  height: 56px !important;
  width: 112px !important;
  min-width: 112px !important;
  object-fit: contain !important;
  border-radius: 4px !important;
  border: 1px solid #747775 !important;
  background: #f8f9fa !important;
  cursor: pointer !important;
}
.auth-box .btn-code {
  height: 56px !important;
  padding: 0 16px !important;
  border-radius: 20px !important;
  border: 0 !important;
  background: #0b57d0 !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
}
.auth-box .btn-code:disabled {
  background: #e3e3e3 !important;
  color: #1f1f1f !important;
}
.auth-box .forgot-link {
  color: #0b57d0 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
}
.auth-box .forgot-link:hover { text-decoration: underline !important; }

.auth-box .strength-meter {
  height: 4px !important;
  background: #e3e3e3 !important;
  border-radius: 2px !important;
  margin-top: 8px !important;
}
.auth-box .strength-bar { height: 4px !important; border-radius: 2px !important; }

.auth-box .btn-submit {
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 80px !important;
  height: 40px !important;
  padding: 0 24px !important;
  border: 0 !important;
  border-radius: 20px !important;
  background: #0b57d0 !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
  float: none !important;
}
.auth-box .btn-submit:hover { background: #0842a0 !important; }
.auth-box .btn-submit:disabled {
  background: #e3e3e3 !important;
  color: #1f1f1f !important;
}

.auth-box .auth-legal {
  clear: both;
  text-align: left !important;
  font-size: 12px !important;
  line-height: 16px !important;
  color: #444746 !important;
  background: transparent !important;
  border: 0 !important;
  padding: 16px 0 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  order: 20;
}
.auth-box .cb-ia-auth-right .form-group { order: 10; }
.auth-box .cb-ia-auth-actions { order: 30; }
.auth-box .auth-legal a { color: #0b57d0 !important; }

.auth-box .cb-ia-auth-actions {
  grid-column: 2;
  display: flex !important;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 32px 0 0 !important;
  min-height: 40px;
}
.auth-box .switch-link {
  text-align: left !important;
  margin: 0 !important;
  font-size: 14px !important;
  color: #1f1f1f !important;
  display: inline-flex !important;
  align-items: center;
}
.auth-box .switch-link > span:not([role="button"]) {
  display: none !important;
}
.auth-box .switch-link [role="button"] {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  color: #0b57d0 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  white-space: nowrap;
}
.auth-box .switch-link [role="button"]:hover {
  background: rgba(11, 87, 208, .08) !important;
  text-decoration: none !important;
}

/* Google two-step: hide password until step 2 */
#loginForm[data-login-step="1"] .cb-ia-login-pass,
#loginForm[data-login-step="1"] .form-group:has(#l_pass) {
  display: none !important;
}
#loginForm[data-login-step="2"] .cb-ia-login-email,
#loginForm[data-login-step="2"] .form-group:has(#l_email) {
  display: none !important;
}
.cb-ia-id-chip {
  display: none;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px 0 8px;
  margin: 16px 0 0;
  border: 1px solid #747775;
  border-radius: 16px;
  background: #fff;
  color: #1f1f1f;
  font-size: 14px;
  cursor: pointer;
}
.cb-ia-id-chip:hover { background: #f8fafd; }
.cb-ia-id-chip::before {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #c2e7ff;
  flex: 0 0 20px;
}

#regForm[data-reg-step="1"] .cb-ia-reg-s2 {
  display: none !important;
}
#regForm[data-reg-step="2"] .cb-ia-reg-s1 {
  display: none !important;
}
#regForm[data-reg-step="2"] #r_email {
  pointer-events: none;
}
#regForm[data-reg-step="1"] #btnCode {
  display: none !important;
}
#regForm .cb-ia-auth-right { padding-top: 24px; }

@media (max-width: 839px) {
  .auth-box {
    width: min(450px, calc(100vw - 24px)) !important;
    padding: 28px 24px 24px !important;
    border-radius: 28px !important;
    min-height: 0 !important;
  }
  .auth-box form.is-active,
  .auth-box #loginForm:not([style*="none"]),
  .auth-box #regForm[style*="block"],
  .auth-box #forgotForm[style*="block"] {
    grid-template-columns: 1fr !important;
  }
  .auth-box .cb-ia-auth-left,
  .auth-box .cb-ia-auth-right { grid-column: 1 !important; }
  #loginForm .cb-ia-auth-right { padding-top: 0; }
  .auth-box h2,
  .auth-box #authTitle { font-size: 32px !important; line-height: 40px !important; }
}

.auth-box .form-control.is-invalid {
  border-color: var(--danger, #d93025) !important;
}
.auth-box .form-group:focus-within .form-control.is-invalid {
  border-color: var(--danger, #d93025) !important;
}
.auth-box .field-error {
  color: var(--danger, #d93025);
  font-size: 12px;
  line-height: 16px;
  margin-top: 6px;
  min-height: 0;
}
.auth-box .field-error[hidden] { display: none !important; }
.auth-box .btn-submit {
  min-height: 44px !important;
  height: 44px !important;
  position: relative !important;
}
.auth-box .btn-submit.is-loading {
  color: transparent !important;
  pointer-events: none !important;
}
.auth-box .btn-submit.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent-contrast, #fff);
  border-top-color: transparent;
  border-radius: 50%;
  animation: cb-auth-spin .7s linear infinite;
}
@keyframes cb-auth-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .auth-box .btn-submit.is-loading::after { animation: none; }
}


/* auth chrome: accent fallback is Sign-in blue, never #f5c518. Logo mark untouched. */
.auth-box {
  --accent: #065fd4;
  --accent-hover: #0556bf;
}
.auth-box .empty-state,
.auth-box .field-error {
  color: var(--danger, #d93025);
}
.auth-box .form-group:focus-within .form-control:not(.is-invalid) {
  border-color: var(--accent, #065fd4) !important;
}
