/* Airtap website auth controls and login modal */

:root {
  --auth-surface: #fbfbfc;
  --auth-title: #252734;
  --auth-body: #43475d;
  --auth-muted: #818495;
  --auth-border: #ebebef;
  --auth-input-border: #ebebef;
  --auth-input-bg: #fbfbfc;
  --auth-primary: #16181f;
  --auth-primary-hover: #2d2f3e;
  --auth-primary-text: #fbfbfc;
  --auth-secondary: #d2d3d9;
  --auth-secondary-hover: #c4c6ce;
  --auth-disabled-bg: #f2f2f2;
  --auth-disabled-text: #9e9e9e;
  --auth-accent: #714fee;
  --auth-accent-soft: #f3efff;
  --auth-error: #b42318;
  --auth-focus: rgba(113, 79, 238, 0.24);
}

.auth-nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-profile-trigger {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--auth-body);
  cursor: pointer;
}

.auth-profile-trigger:hover,
.auth-profile-trigger:focus-visible {
  background: rgba(113, 79, 238, 0.08);
  outline: none;
}

.auth-profile-trigger:focus-visible {
  box-shadow: 0 0 0 3px var(--auth-focus);
}

.auth-profile-empty-icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  color: #3C3F53;
}

.auth-profile-empty-icon svg {
  display: block;
  width: 30px;
  height: 30px;
}

.auth-avatar-frame {
  display: none;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--auth-muted);
  border-radius: 999px;
  background: linear-gradient(135deg, #6a4df4, #f28bdc);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.auth-avatar-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-nav-item.is-authenticated .auth-profile-empty-icon {
  display: none;
}

.auth-nav-item.is-authenticated .auth-avatar-frame {
  display: inline-flex;
}

.auth-nav-item.is-flyout-open .auth-avatar-frame {
  border: 2px solid var(--auth-accent);
}

.auth-flyout {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  display: flex;
  width: 280px;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  background: var(--auth-surface);
  box-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.1);
}

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

.auth-flyout-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.auth-flyout-name,
.auth-flyout-contact {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-flyout-name {
  color: var(--auth-title);
  font-size: 16px;
  line-height: 20px;
}

.auth-flyout-contact {
  color: var(--auth-body);
  font-size: 12px;
  line-height: 16px;
}

.auth-flyout-divider {
  width: 100%;
  height: 1px;
  background: var(--auth-border);
}

.auth-logout-button {
  display: inline-flex;
  height: 40px;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid var(--auth-secondary);
  border-radius: 8px;
  background: transparent;
  color: #3c3f53;
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  line-height: 20px;
}

.auth-logout-button:hover,
.auth-logout-button:focus-visible {
  background: #f7f7f9;
  outline: none;
}

.auth-logout-button:focus-visible {
  box-shadow: 0 0 0 3px var(--auth-focus);
}

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

.website-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.website-auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.website-auth-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: 400px;
  max-width: min(100%, 440px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--auth-border);
  border-radius: 20px;
  background: var(--auth-surface);
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.08);
  color: var(--auth-title);
}

.website-auth-close {
  position: absolute;
  top: 11px;
  right: 11px;
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #2d2f3e;
  cursor: pointer;
}

.website-auth-close:hover,
.website-auth-close:focus-visible {
  background: rgba(45, 47, 62, 0.06);
  outline: none;
}

.website-auth-close:focus-visible {
  box-shadow: 0 0 0 3px var(--auth-focus);
}

.website-auth-hero {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.website-auth-logo {
  display: block;
  width: 64px;
  height: auto;
}

.website-auth-title {
  margin: 0;
  color: var(--auth-title);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 36px;
}

.website-auth-subtitle {
  margin: 0;
  color: var(--auth-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
}

.website-auth-form,
.website-auth-section {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 8px;
}

.website-auth-row {
  display: flex;
  width: 100%;
  gap: 8px;
}

.website-auth-country-wrap {
  position: relative;
  width: 115px;
  flex: 0 0 auto;
}

.website-auth-select,
.website-auth-input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--auth-input-border);
  border-radius: 8px;
  background: var(--auth-input-bg);
  color: var(--auth-title);
  font: inherit;
  font-size: 16px;
  line-height: 20px;
  outline: none;
}

.website-auth-select {
  appearance: none;
  padding: 8px 27px 8px 10px;
}

.website-auth-input {
  padding: 8px 12px;
}

.website-auth-otp-input {
  text-align: center;
}

.website-auth-select:focus-visible,
.website-auth-input:focus-visible {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px var(--auth-focus);
}

.website-auth-input::placeholder {
  color: #5d6077;
}

.website-auth-select-icon {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  pointer-events: none;
  color: #5d6077;
}

.website-auth-button {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border: 1px solid var(--auth-primary);
  border-radius: 8px;
  background: var(--auth-primary);
  color: var(--auth-primary-text);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.website-auth-button:hover:not(:disabled),
.website-auth-button:focus-visible:not(:disabled) {
  border-color: var(--auth-primary-hover);
  background: var(--auth-primary-hover);
  outline: none;
}

.website-auth-button:focus-visible:not(:disabled) {
  box-shadow: 0 0 0 3px var(--auth-focus);
}

.website-auth-button:disabled {
  border-color: var(--auth-disabled-bg);
  background: var(--auth-disabled-bg);
  color: var(--auth-disabled-text);
  cursor: not-allowed;
}

.website-auth-button-secondary {
  border-color: var(--auth-secondary);
  background: var(--auth-secondary);
  color: var(--auth-title);
}

.website-auth-button-secondary:hover:not(:disabled),
.website-auth-button-secondary:focus-visible:not(:disabled) {
  border-color: var(--auth-secondary-hover);
  background: var(--auth-secondary-hover);
}

.website-auth-actions-row {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.website-auth-divider {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 18px;
}

.website-auth-divider::before,
.website-auth-divider::after {
  display: block;
  height: 1px;
  flex: 1;
  background: var(--auth-border);
  content: "";
}

.website-auth-google-frame {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border-radius: 8px;
}

.website-auth-google-host {
  display: flex;
  width: fit-content;
  max-width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.website-auth-google-placeholder {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid rgba(18, 20, 20, 0.3);
  border-radius: 8px;
  background: #fff;
  color: #000;
  font-size: 18px;
  line-height: 24px;
}

.website-auth-google-mark {
  display: inline-flex;
  width: 22px;
  height: 22px;
}

.website-auth-otp-meta {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 18px;
}

.website-auth-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--auth-accent);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  line-height: 20px;
}

.website-auth-link-button:hover:not(:disabled),
.website-auth-link-button:focus-visible:not(:disabled) {
  background: var(--auth-accent-soft);
  outline: none;
}

.website-auth-link-button:focus-visible:not(:disabled) {
  box-shadow: 0 0 0 3px var(--auth-focus);
}

.website-auth-link-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.website-auth-error {
  width: 100%;
  margin: -4px 0 0;
  color: var(--auth-error);
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}

.website-auth-error[hidden],
.website-auth-step[hidden],
.website-auth-divider[hidden],
.website-auth-google-frame[hidden],
.website-auth-recaptcha[hidden] {
  display: none;
}

.website-auth-busy-dots {
  display: inline-flex;
  align-items: end;
  gap: 2px;
  height: 16px;
  padding-bottom: 3px;
}

.website-auth-busy-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: website-auth-bounce 0.9s infinite ease-in-out;
}

.website-auth-busy-dots span:nth-child(1) { animation-delay: -0.24s; }
.website-auth-busy-dots span:nth-child(2) { animation-delay: -0.12s; }

@keyframes website-auth-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
}

@media (max-width: 760px) {
  .auth-nav-item {
    flex: 0 0 auto;
  }

  .auth-flyout {
    right: -6px;
    width: min(280px, calc(100vw - 28px));
  }

  .website-auth-modal {
    align-items: center;
    padding: 20px;
  }

  .website-auth-dialog {
    width: 440px;
    max-width: 100%;
  }
}

@media (max-width: 430px) {
  .website-auth-dialog {
    padding: 24px;
  }

  .website-auth-row {
    gap: 8px;
  }

  .website-auth-google-placeholder {
    font-size: 17px;
  }
}
