/*
 * Canonical OAuth provider button + connected-account styles.
 *
 * Single source of truth for Google sign-in UI compliance.
 * Uses Reasoned landing theme tokens (--reasoned-*) for layout chrome only;
 * provider fill, border, type, and copy colours are fixed per vendor guidelines.
 *
 * Before changing colours, fonts, borders, logos, or button layout, review:
 *   Google: https://developers.google.com/identity/branding-guidelines
 *
 * Button copy: frontend-shared/scripts/oauth-providers.js (providerActionText)
 * Attribution: Reasoned/licenses/THIRD-PARTY-BRANDING.md
 *
 * Compile: npx sass oauth-providers.scss oauth-providers.css
 */

/* ── Provider button stack (login, signup, settings link) ── */

.rt-oauth-providers {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.rt-oauth-providers--flush {
  margin: 0;
}

/* Official GIS mounts. Do not restyle the vendor iframe/button. */
.rt-oauth-slot,
.rt-oauth-official {
  width: 100%;
  min-height: 44px;
}

.rt-oauth-official--google {
  width: 100%;
}

/* GIS paints a square white pad (legacy #container-div.haAclf or current
   .S9gUrf-YoZ4jf / .L5Fo6c-sM5MNb). JS wraps that in .rt-oauth-google-shell;
   CSS also clips the GIS roots directly as a fallback. */
.rt-oauth-providers,
.rt-central-login .rt-oauth-providers,
.rt-central-signup .rt-oauth-providers,
.reasoned-auth-card .rt-oauth-providers {
  justify-items: center;
}

.rt-oauth-official--google,
.rt-oauth-slot[data-provider=google] {
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent !important;
  background-color: transparent !important;
}

.rt-oauth-google-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  /* Outline pad is always white; pin label so OS dark preference cannot
     paint GIS "Sign in with Google" white-on-white (CRM light mode). */
  color: #1f1f1f;
  line-height: 0;
}

/* Clip GIS chrome whether or not JS has inserted the shell yet. */
.rt-oauth-google-shell .S9gUrf-YoZ4jf,
.rt-oauth-google-shell .L5Fo6c-sM5MNb,
.rt-oauth-google-shell #container-div,
.rt-oauth-google-shell #container-div.haAclf,
.rt-oauth-google-shell .haAclf,
.rt-oauth-official--google .S9gUrf-YoZ4jf,
.rt-oauth-official--google .L5Fo6c-sM5MNb,
.rt-oauth-official--google #container-div.haAclf,
.rt-oauth-slot[data-provider=google] .S9gUrf-YoZ4jf,
.rt-oauth-slot[data-provider=google] .L5Fo6c-sM5MNb,
.reasoned-auth-card .S9gUrf-YoZ4jf,
.reasoned-auth-card .L5Fo6c-sM5MNb,
.rt-oauth-providers .S9gUrf-YoZ4jf,
.rt-oauth-providers .L5Fo6c-sM5MNb {
  border-radius: 999px !important;
  overflow: hidden !important;
  background: #fff !important;
  background-color: #fff !important;
  box-shadow: none !important;
  border: 0 !important;
  margin: 0 !important;
  max-width: 100%;
  color: #1f1f1f !important;
}

/* GIS label + button root (obfuscated class names; keep readable on white pad). */
.rt-oauth-google-shell [role=button],
.rt-oauth-google-shell span,
.rt-oauth-official--google [role=button],
.rt-oauth-official--google span,
.rt-oauth-slot[data-provider=google] [role=button],
.rt-oauth-slot[data-provider=google] span,
.rt-oauth-providers .rt-oauth-official--google [role=button],
.rt-oauth-providers .rt-oauth-official--google span {
  color: #1f1f1f !important;
}

.rt-oauth-providers__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--reasoned-text-muted, rgba(255, 255, 255, 0.55));
  font: 500 12px/1.2 var(--reasoned-font-ui, Inter, system-ui, sans-serif);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 4px 0 2px;
}

.rt-oauth-providers__divider::before,
.rt-oauth-providers__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--reasoned-border, rgba(255, 255, 255, 0.12));
}

.rt-oauth-provider-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--reasoned-radius-control, 10px);
  border: 1px solid var(--reasoned-border, rgba(255, 255, 255, 0.14));
  background: rgba(255, 255, 255, 0.04);
  color: var(--reasoned-text, #fff);
  font: 600 14px/1.2 var(--reasoned-font-ui, Inter, system-ui, sans-serif);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.rt-oauth-provider-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.rt-oauth-provider-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.rt-oauth-provider-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Google outline theme: #FFFFFF fill, #747775 1px border, #1F1F1F text, 14/20 type. */
.rt-oauth-provider-btn[data-provider=google] {
  background: #ffffff;
  border: 1px solid #747775;
  color: #1f1f1f;
  font: 500 14px/20px "Google Sans", Roboto, Helvetica, Arial, sans-serif;
}

.rt-oauth-provider-btn[data-provider=google]:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #747775;
}

.rt-oauth-provider-btn__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rt-oauth-provider-btn__icon[src] {
  object-fit: contain;
}

.rt-oauth-provider-btn__label {
  white-space: nowrap;
}

/* ── Connected accounts (Settings Security) ── */

.rt-oauth-connected-accounts {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.rt-oauth-connected-accounts-mount {
  margin-bottom: 24px;
}

.rt-oauth-connected-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--reasoned-radius-card, 12px);
  border: 1px solid var(--reasoned-border, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.03);
}

.rt-oauth-connected-row__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  object-fit: contain;
}

.rt-oauth-connected-row__meta {
  flex: 1;
  min-width: 0;
}

.rt-oauth-connected-row__meta strong {
  display: block;
  font: 600 14px/1.3 var(--reasoned-font-ui, Inter, system-ui, sans-serif);
  color: var(--reasoned-text, #fff);
}

.rt-oauth-connected-row__meta span {
  display: block;
  color: var(--reasoned-text-secondary, rgba(255, 255, 255, 0.62));
  font: 400 13px/1.4 var(--reasoned-font-ui, Inter, system-ui, sans-serif);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rt-oauth-connected-row__unlink {
  border: 1px solid var(--reasoned-border, rgba(255, 255, 255, 0.14));
  border-radius: var(--reasoned-radius-control, 10px);
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--reasoned-text-secondary, rgba(255, 255, 255, 0.86));
  font: 600 12px/1 var(--reasoned-font-ui, Inter, system-ui, sans-serif);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.rt-oauth-connected-row__unlink:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.rt-oauth-connected-row__unlink:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Misc auth surfaces ── */

.rt-oauth-dev-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 193, 7, 0.14);
  color: #ffd76a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.rt-passwordless-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--reasoned-radius-card, 12px);
  background: var(--reasoned-primary-soft, rgba(0, 194, 129, 0.1));
  border: 1px solid var(--reasoned-border-strong, rgba(0, 194, 129, 0.24));
  color: var(--reasoned-text, rgba(255, 255, 255, 0.86));
  font: 400 13px/1.5 var(--reasoned-font-ui, Inter, system-ui, sans-serif);
}
