.brvc-auth-modal {
  inset: 0;
  position: fixed;
  z-index: 12000;
}

.brvc-auth-modal[hidden] {
  display: none;
}

.brvc-auth-modal__backdrop {
  background: rgba(0, 0, 0, 0.62);
  inset: 0;
  position: absolute;
}

.brvc-auth-modal__dialog {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  color: #111827;
  display: grid;
  grid-template-rows: auto 1fr auto;
  left: 50%;
  max-height: min(92vh, 720px);
  max-width: 440px;
  overflow: hidden;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
}

.brvc-auth-modal__header,
.brvc-auth-modal__body,
.brvc-auth-modal__footer {
  padding: 20px 22px;
}

.brvc-auth-modal__header {
  align-items: flex-start;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.brvc-auth-modal__header h2 {
  font-size: 1.25rem;
  margin: 0 0 4px;
}

.brvc-auth-modal__close {
  background: #f3f4f6;
  border: 0;
  border-radius: 999px;
  color: #111827;
  cursor: pointer;
  font-size: 1.4rem;
  height: 36px;
  line-height: 1;
  width: 36px;
}

.brvc-auth-modal__body {
  overflow-y: auto;
}

.brvc-auth-modal__footer {
  border-top: 1px solid #e5e7eb;
  font-size: 0.82rem;
  line-height: 1.45;
}

.brvc-auth-modal__footer a {
  color: #047857;
}

.brvc-auth-provider-stack,
.brvc-auth-provider-row {
  display: grid;
  gap: 10px;
}

.brvc-auth-provider-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.brvc-auth-provider-btn {
  align-items: center;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 600;
  gap: 10px;
  justify-content: center;
  min-height: 46px;
  padding: 10px 16px;
  width: 100%;
}

.brvc-auth-provider-btn__icon {
  display: inline-flex;
  flex-shrink: 0;
  height: 20px;
  width: 20px;
}

.brvc-auth-provider-btn__icon svg {
  display: block;
  height: 100%;
  width: 100%;
}

.brvc-auth-provider-btn__label {
  line-height: 1.2;
}

.brvc-auth-provider-btn:hover,
.brvc-auth-provider-btn:focus-visible {
  border-color: #047857;
}

.brvc-auth-provider-btn--compact {
  border-radius: 14px;
  flex-direction: column;
  font-size: 0.82rem;
  gap: 6px;
  min-height: 72px;
  padding: 10px 8px;
}

.brvc-auth-provider-btn--compact .brvc-auth-provider-btn__icon {
  height: 24px;
  width: 24px;
}

.brvc-auth-oauth-feedback {
  color: #b45309;
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0 0 10px;
}

.brvc-auth-oauth-feedback.is-error {
  color: #b91c1c;
}

.brvc-auth-divider {
  align-items: center;
  color: #6b7280;
  display: flex;
  font-size: 0.85rem;
  gap: 12px;
  margin: 16px 0;
  text-align: center;
}

.brvc-auth-divider[hidden] {
  display: none !important;
}

.brvc-auth-provider-row[hidden],
.brvc-auth-provider-stack[hidden] {
  display: none !important;
}

.brvc-auth-divider::before,
.brvc-auth-divider::after {
  background: #e5e7eb;
  content: '';
  flex: 1;
  height: 1px;
}

.brvc-auth-tabs {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 14px;
}

.brvc-auth-tab {
  background: #f3f4f6;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 40px;
  padding: 8px 12px;
}

.brvc-auth-tab.is-active {
  background: #ecfdf5;
  border-color: #047857;
  color: #047857;
}

.brvc-auth-form label {
  display: grid;
  font-size: 0.92rem;
  gap: 6px;
  margin-bottom: 12px;
}

.brvc-auth-form input {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  min-height: 42px;
  padding: 10px 12px;
}

.brvc-auth-form button[type='submit'] {
  background: #047857;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  margin-top: 4px;
  min-height: 44px;
  width: 100%;
}

.brvc-auth-form button[type='submit']:disabled {
  opacity: 0.65;
}

.brvc-auth-secondary-links {
  display: flex;
  flex-wrap: wrap;
  font-size: 0.88rem;
  gap: 12px;
  justify-content: space-between;
  margin-top: 12px;
}

.brvc-auth-link-btn {
  background: none;
  border: 0;
  color: #047857;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

.auth-feedback {
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 12px;
  min-height: 0;
  padding: 0;
}

.auth-feedback.is-error,
.auth-feedback.is-success {
  padding: 10px 12px;
}

.auth-feedback.is-error {
  background: #fef2f2;
  color: #b91c1c;
}

.auth-feedback.is-success {
  background: #ecfdf5;
  color: #047857;
}

.brvc-auth-subtitle {
  font-size: 1.05rem;
  margin: 0 0 8px;
}

body.brvc-auth-modal-open {
  overflow: hidden;
}

@media (max-width: 480px) {
  .brvc-auth-modal__dialog {
    border-radius: 0;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    inset: 0;
    left: 0;
    max-height: none;
    max-width: none;
    top: 0;
    transform: none;
    width: 100vw;
  }

  .brvc-auth-modal__body {
    flex: 1;
  }
}
