.auth-open-button {
  flex-shrink: 0;
  min-height: 38px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  background: var(--glass-surface-control);
  color: var(--text-primary);
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--glass-shadow-sm);
  transition: all 0.2s var(--ease-apple);
  cursor: pointer;
}

.auth-open-button:hover {
  background: var(--glass-surface-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

.auth-open-button:active {
  transform: scale(0.96);
}

.auth-dialog {
  position: fixed;
  inset: 0;
  width: min(100% - 32px, 420px);
  max-width: 420px;
  max-height: min(90vh, 760px);
  margin: auto;
  padding: 28px 30px;
  overflow-y: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg, 12px);
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-text);
}

.auth-dialog::backdrop {
  background: rgba(11, 13, 18, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-xs);
  background: var(--bg-control);
  color: var(--text-muted);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
}

.auth-close:hover {
  background: var(--bg-control-hover);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.auth-brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  background: #101828;
  color: var(--accent-primary, #F26B38);
  font: 800 19px var(--font-display);
  border: 1px solid #1C2430;
}

.auth-dialog .section-kicker {
  color: var(--accent-primary, #F26B38);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
}

.auth-dialog h2 {
  margin: 6px 0 4px;
  color: var(--text-primary);
  font: 800 24px/1.2 var(--font-display);
  letter-spacing: -0.025em;
}

.auth-intro {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 20px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-control);
  border: 1px solid var(--border-default);
}

.auth-tabs button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-text);
  cursor: pointer;
  transition: all 0.16s ease;
}

.auth-tabs button:hover {
  color: var(--text-primary);
}

.auth-tabs button.is-active {
  background: var(--bg-surface) !important;
  color: var(--accent-primary, #F26B38) !important;
  border-color: var(--border-default) !important;
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-form[hidden],
.auth-account-panel[hidden] {
  display: none;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--text-secondary, #344054);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.auth-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-control, #dce4ef);
  border-radius: var(--radius-sm, 8px);
  outline: none;
  background: var(--bg-control, #fff);
  color: var(--text-primary, #101828);
  font-family: var(--font-text);
  font-size: 13px;
  transition: all 0.16s ease;
}

.auth-form input:focus {
  border-color: var(--accent-primary, #F26B38);
  box-shadow: 0 0 0 3px rgba(242, 107, 56, 0.18);
}

.auth-hint,
.auth-privacy {
  margin: -5px 0 0;
  color: var(--text-muted, #98A2B3);
  font-size: 11px;
  line-height: 1.4;
}

.auth-error {
  margin: 0;
  color: var(--accent-red, #D94A4A);
  font-size: 11px;
  font-weight: 600;
}

.auth-submit {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 8px);
  background: #101828;
  color: #fff;
  font-family: var(--font-text);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.auth-submit:hover {
  background: #1C2430;
  border-color: #344054;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: .65;
}

.auth-secondary {
  min-height: 38px;
  border: 1px solid var(--border-control, #dce4ef);
  border-radius: var(--radius-sm, 8px);
  background: transparent;
  color: var(--text-secondary, #344054);
  font-family: var(--font-text);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.auth-secondary:hover {
  background: var(--bg-control-hover, #f8fafc);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.auth-account-panel {
  display: grid;
  gap: 8px;
}

.auth-admin-panel {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e5eaf1;
}

.auth-admin-panel[hidden] {
  display: none;
}

.auth-admin-panel ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-admin-panel li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #34435b;
  font-size: 11px;
}

.auth-approve {
  flex-shrink: 0;
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  background: #101a2d;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.auth-approve:disabled {
  cursor: wait;
  opacity: .65;
}

.auth-account-panel p {
  margin: 0;
  color: #68768a;
  font-size: 12px;
}

.auth-account-panel strong {
  font: 700 17px Manrope, sans-serif;
}

.auth-account-panel > span {
  color: #68768a;
  font-size: 12px;
}

.auth-signout {
  margin-top: 8px;
}

.auth-privacy {
  margin-top: 18px;
  text-align: center;
}

html[data-theme="dark"] .auth-dialog {
  border-color: #1C2430;
  background: #101828;
  color: #f8fafc;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}

html[data-theme="dark"] .auth-dialog h2 {
  color: #f8fafc;
}

html[data-theme="dark"] .auth-tabs {
  background: #0B0D12;
  border-color: #1C2430;
}

html[data-theme="dark"] .auth-tabs button {
  color: #98A2B3;
}

html[data-theme="dark"] .auth-tabs button:hover {
  background: #1C2430;
  color: #f8fafc;
}

html[data-theme="dark"] .auth-tabs button.is-active {
  background: #1C2430 !important;
  border-color: #F26B38 !important;
  color: #F26B38 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .auth-form label {
  color: #98A2B3;
}

html[data-theme="dark"] .auth-form input {
  border-color: #344054;
  background: #1C2430;
  color: #f8fafc;
}

html[data-theme="dark"] .auth-form input:focus {
  border-color: #F26B38;
  box-shadow: 0 0 0 3px rgba(242, 107, 56, 0.25);
}

html[data-theme="dark"] .auth-submit {
  background: #F26B38;
  color: #FFFFFF;
  border: 1px solid #F26B38;
  font-weight: 700;
}

html[data-theme="dark"] .auth-submit:hover {
  background: #e05e2d;
  border-color: #e05e2d;
}

html[data-theme="dark"] .auth-secondary {
  border-color: #344054;
  background: #1C2430;
  color: #98A2B3;
}

html[data-theme="dark"] .auth-secondary:hover {
  background: #242f3e;
  border-color: #475467;
  color: #f8fafc;
}

html[data-theme="dark"] .auth-admin-panel {
  border-color: #1C2430;
  background: #0B0D12;
}

html[data-theme="dark"] .auth-admin-panel li {
  color: #98A2B3;
}

@media (max-width: 1050px) {
  .auth-open-button {
    padding: 0 16px;
    font-size: 12px;
  }
}

@media (max-width: 820px) {
  .auth-open-button {
    min-height: 36px;
    height: 36px;
    padding: 0 14px;
    font-size: 11.5px;
    border-radius: 9px;
  }
}

@media (max-width: 540px) {
  .auth-open-button {
    min-height: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 11px;
  }

  .auth-dialog {
    width: min(calc(100% - 24px), 430px);
    max-width: calc(100% - 24px);
    padding: 24px 18px;
    border-radius: 14px;
  }
}

@media (max-width: 360px) {
  .auth-open-button {
    min-height: 34px;
    height: 34px;
    padding: 0 10px;
    font-size: 10.5px;
  }

  .header-user-name {
    display: none;
  }

  .auth-open-button.is-logged-in {
    padding: 0;
    width: 34px;
    min-width: 34px;
    height: 34px;
    justify-content: center;
  }

  .auth-dialog {
    padding: 20px 14px;
  }
}


/* Google Sign-In and Avatar Styles */
.auth-open-button.is-logged-in {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 8px;
}

.header-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #fff;
  display: inline-block;
  vertical-align: middle;
}

.header-avatar-initial {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.header-user-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-oauth-block {
  margin-bottom: 16px;
}

.google-signin-btn {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #dadce0;
  border-radius: 9px;
  background: #ffffff;
  color: #3c4043;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 1px 2px rgba(60,64,67,.08);
}

.google-signin-btn:hover {
  background: #f8fafd;
  border-color: #c2d7fa;
  box-shadow: 0 1px 3px rgba(60,64,67,.18);
}

.google-signin-btn:disabled {
  opacity: .65;
  cursor: wait;
}

.google-icon {
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
  text-align: center;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.auth-divider span {
  padding: 0 10px;
}

.auth-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 18px;
}

.auth-account-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
}

.auth-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.auth-profile-meta strong {
  font-size: 15px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-profile-meta span {
  font-size: 12px;
  color: #64748b;
  word-break: break-all;
}

.auth-provider-badge {
  display: inline-block;
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.auth-provider-badge.google {
  background: #e8f0fe;
  color: #1a73e8;
  border: 1px solid #d2e3fc;
}

.auth-provider-badge.email {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Dark mode adjustments */
html[data-theme="dark"] .google-signin-btn {
  background: #1e293b;
  border-color: #344157;
  color: #f8fafc;
}

html[data-theme="dark"] .google-signin-btn:hover {
  background: #263750;
  border-color: #506686;
}

html[data-theme="dark"] .auth-divider {
  color: #94a3b8;
}

html[data-theme="dark"] .auth-divider::before,
html[data-theme="dark"] .auth-divider::after {
  border-color: #344157;
}

html[data-theme="dark"] .auth-profile-card {
  background: #1b2940;
  border-color: #344157;
}

html[data-theme="dark"] .auth-profile-meta strong {
  color: #f8fafc;
}

html[data-theme="dark"] .auth-profile-meta span {
  color: #94a3b8;
}

/* ==============================================================
   GOOGLE ACCOUNT PICKER (Native Google Chooser Experience)
   ============================================================== */
.google-account-picker {
  margin: 10px 0 16px;
  animation: fadeInAuth .2s ease-out;
}

@keyframes fadeInAuth {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.gap-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}

.gap-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #101a2d;
}

.gap-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
}

.gap-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.gap-account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease;
  font-family: inherit;
}

.gap-account-item:hover {
  background: #f8fafd;
  border-color: #4285f4;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(66, 133, 244, 0.12);
}

.gap-account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.gap-account-initial {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a73e8, #4285f4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(26, 115, 232, 0.3);
}

.gap-account-meta {
  flex: 1;
  min-width: 0;
}

.gap-account-name {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gap-account-email {
  font-size: 11.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gap-account-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: #e8f0fe;
  color: #1a73e8;
  border: 1px solid #d2e3fc;
  flex-shrink: 0;
}

.gap-use-another-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
  transition: all .15s ease;
  font-family: inherit;
  margin-bottom: 10px;
}

.gap-use-another-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.gap-avatar-add {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e8f0fe;
  color: #1a73e8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 500;
  flex-shrink: 0;
}

.gap-custom-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.gap-custom-box label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
  display: block;
}

.gap-custom-box input {
  width: 100%;
  margin-bottom: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  box-sizing: border-box;
  font-family: inherit;
}

.gap-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #edf2f7;
}

.gap-secure-badge {
  font-size: 11px;
  color: #10b981;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Dark mode overrides for Google Account Picker */
html[data-theme="dark"] .gap-header {
  border-bottom-color: #1C2430;
}

html[data-theme="dark"] .gap-title {
  color: #f8fafc;
}

html[data-theme="dark"] .gap-subtitle {
  color: #98A2B3;
}

html[data-theme="dark"] .gap-account-item {
  background: #101828;
  border-color: #1C2430;
}

html[data-theme="dark"] .gap-account-item:hover {
  background: #1C2430;
  border-color: #F26B38;
  box-shadow: 0 3px 8px rgba(242, 107, 56, 0.15);
}

html[data-theme="dark"] .gap-account-name {
  color: #f8fafc;
}

html[data-theme="dark"] .gap-account-email {
  color: #98A2B3;
}

html[data-theme="dark"] .gap-account-badge {
  background: rgba(242, 107, 56, 0.15);
  color: #F26B38;
  border-color: rgba(242, 107, 56, 0.35);
}

html[data-theme="dark"] .gap-use-another-btn {
  background: #101828;
  border-color: #1C2430;
  color: #98A2B3;
}

html[data-theme="dark"] .gap-use-another-btn:hover {
  background: #1C2430;
  border-color: #344054;
  color: #f8fafc;
}

html[data-theme="dark"] .gap-avatar-add {
  background: #1C2430;
  color: #F26B38;
}

html[data-theme="dark"] .gap-custom-box {
  background: #101828;
  border-color: #1C2430;
}

html[data-theme="dark"] .gap-custom-box label {
  color: #98A2B3;
}

html[data-theme="dark"] .gap-custom-box input {
  background: #1C2430;
  border-color: #344054;
  color: #f8fafc;
}

html[data-theme="dark"] .gap-footer {
  border-top-color: #1C2430;
}



/* Supabase Auth UI Enhancements */
.auth-row-between {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.auth-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #3b82f6;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-link-btn:hover {
  color: #1d4ed8;
}

.input-helper {
  color: #64748b;
  font-size: 10px;
  font-weight: normal;
  margin-top: 2px;
}

.auth-otp-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.auth-otp-actions button {
  flex: 1;
}

.auth-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-provider-badge.supabase {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

html[data-theme="dark"] .auth-provider-badge.supabase {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #047857;
}

html[data-theme="dark"] .auth-link-btn {
  color: #60a5fa;
}

html[data-theme="dark"] .auth-link-btn:hover {
  color: #93c5fd;
}

html[data-theme="dark"] .input-helper {
  color: #94a3b8;
}

/* Password Strength Checklist Styles */
.password-checklist {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  margin-top: 4px;
  margin-bottom: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.2;
}

.check-item .check-icon {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 50%;
  color: #94a3b8;
}

.check-item.is-valid {
  color: #059669;
  font-weight: 600;
}

.check-item.is-valid .check-icon {
  color: #059669;
}

.password-match-hint {
  font-size: 11px;
  font-weight: 600;
  margin-top: -4px;
}

.password-match-hint.is-matched {
  color: #059669;
}

.password-match-hint.is-mismatched {
  color: #dc2626;
}

html[data-theme="dark"] .password-checklist {
  background: #0f172a;
  border-color: #334155;
}

html[data-theme="dark"] .check-item {
  color: #94a3b8;
}

html[data-theme="dark"] .check-item.is-valid {
  color: #34d399;
}

html[data-theme="dark"] .check-item.is-valid .check-icon {
  color: #34d399;
}

/* 6-digit OTP Input styling */
#otpCodeInput {
  font-size: 20px;
  letter-spacing: 6px;
  text-align: center;
  font-weight: 700;
}
