/* Hub ID SDK styles — host-page agnostic, namespaced under .hubid- */

.hubid-card {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 28px 28px 22px;
  max-width: 380px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  color: #18181b;
}

.hubid-title {
  margin: 0 0 18px;
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
}

.hubid-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hubid-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: #52525b;
}

.hubid-label > span {
  font-weight: 500;
}

.hubid-input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  background: #fff;
  font-size: 0.95rem;
  color: #18181b;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.hubid-input:focus {
  outline: none;
  border-color: #6d5dfc;
  box-shadow: 0 0 0 3px rgba(109, 93, 252, 0.15);
}

.hubid-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.hubid-btn {
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.hubid-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.hubid-btn-primary {
  background: #18181b;
  color: #fff;
  margin-top: 4px;
}

.hubid-btn-primary:hover:not(:disabled) {
  background: #27272a;
}

.hubid-btn-google {
  width: 100%;
  background: #fff;
  color: #1f1f1f;
  border-color: #d4d4d8;
}

.hubid-btn-google:hover:not(:disabled) {
  background: #f4f4f5;
}

.hubid-divider {
  position: relative;
  margin: 18px 0 14px;
  text-align: center;
  font-size: 0.8rem;
  color: #71717a;
}

.hubid-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #e4e4e7;
}

.hubid-divider > span {
  position: relative;
  background: #fff;
  padding: 0 10px;
}

.hubid-footer {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  color: #71717a;
}

.hubid-footer a {
  color: #6d5dfc;
  text-decoration: none;
}

.hubid-footer a:hover {
  text-decoration: underline;
}

.hubid-spacer {
  flex: 1;
}

/* ----- Account widget (mountAccount) — compact + popover ----- */

.hubid-account {
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.35;
  color: #18181b;
}

/* Trigger row: avatar + identity + chevron, ~56px tall. */
.hubid-account-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.hubid-account-trigger:hover {
  background: rgba(0, 0, 0, 0.04);
}

.hubid-account-trigger:focus-visible {
  outline: 2px solid #6d5dfc;
  outline-offset: 2px;
}

.hubid-account-trigger[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.04);
}

.hubid-account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: #e4e4e7;
}

.hubid-account-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #6d5dfc;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}

.hubid-account-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hubid-account-name {
  font-weight: 600;
  font-size: 13px;
  color: #18181b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hubid-account-email {
  font-size: 11px;
  color: #71717a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hubid-account-chevron {
  flex-shrink: 0;
  color: #a1a1aa;
  transition: transform 0.18s ease, color 0.12s ease;
}

.hubid-account-trigger[aria-expanded="true"] .hubid-account-chevron {
  transform: rotate(180deg);
  color: #52525b;
}

/* Popover: floating menu anchored to the trigger. */
.hubid-account-popover {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.10);
  padding: 4px;
  animation: hubid-popover-in 140ms cubic-bezier(0.2, 0, 0, 1);
  transform-origin: top center;
}

.hubid-account[data-placement="down"] .hubid-account-popover {
  top: calc(100% + 6px);
}

.hubid-account[data-placement="up"] .hubid-account-popover {
  bottom: calc(100% + 6px);
  transform-origin: bottom center;
}

@keyframes hubid-popover-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hubid-account-popover {
    animation: none;
  }
  .hubid-account-chevron {
    transition: none;
  }
}

.hubid-account-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #27272a;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: background 0.1s ease, color 0.1s ease;
}

.hubid-account-menu-item:hover:not(:disabled),
.hubid-account-menu-item:focus-visible {
  background: rgba(109, 93, 252, 0.08);
  color: #18181b;
  outline: none;
}

.hubid-account-menu-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hubid-account-ext {
  color: #a1a1aa;
  flex-shrink: 0;
}

.hubid-account-brand {
  margin: 4px -4px -4px;
  padding: 8px 14px;
  border-top: 1px solid #f4f4f5;
}

.hubid-account-brand a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 500;
  color: #a1a1aa;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.12s ease;
}

.hubid-account-brand a:hover {
  color: #6d5dfc;
}

.hubid-account-brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6d5dfc;
  display: inline-block;
}
