/* =============================================
   AUTH MODAL — CSS
   Login floater, Google button, overlay
   ============================================= */

/* ---- Overlay backdrop ---- */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.auth-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* ---- Modal card ---- */
.auth-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 28px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.25s ease;
  opacity: 0;
}

.auth-overlay.visible .auth-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ---- Close button ---- */
.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}

.auth-close:hover {
  color: var(--white);
  background: var(--border);
}

/* ---- Logo row ---- */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.auth-logo .logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.auth-logo .logo-wordmark {
  font-family: var(--font-logo);
  font-weight: 500;
  font-size: 16px;
  color: var(--white);
  letter-spacing: 1px;
}

/* ---- Headline ---- */
.auth-headline {
  margin-bottom: 28px;
}

.auth-headline h2 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 28px;
  color: var(--white);
  line-height: 1.2;
  text-transform: uppercase;
}

.auth-headline p {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ---- Google button ---- */
.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.15s;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.auth-google-btn:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  background: #f8f8f8;
}

.auth-google-btn:active {
  background: #f0f0f0;
}

.auth-google-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---- Divider ---- */
.auth-or-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-or-row hr {
  flex: 1;
  border: none;
  border-top: 1px solid var(--border);
}

.auth-or-row span {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  white-space: nowrap;
}

/* ---- App logos strip ---- */
.auth-apps-label {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 10px;
}

.auth-apps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  margin-bottom: 24px;
}

.auth-app-chip {
  font-family: var(--font-headline);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
}

/* ---- Terms ---- */
.auth-terms {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.auth-terms a {
  color: var(--muted);
  text-decoration: underline;
  transition: color 0.2s;
}

.auth-terms a:hover { color: var(--white); }

/* ---- Logged-in state: user pill in navbar ---- */
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
}

.nav-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  object-fit: cover;
}

.nav-user-name {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--white);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}

.nav-user:hover .nav-user-name {
  color: var(--accent);
}

/* User dropdown */
.nav-user-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  min-width: 160px;
  display: none;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.nav-user.open .nav-user-menu {
  display: block;
}

.nav-user-menu a,
.nav-user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-user-menu a:hover,
.nav-user-menu button:hover {
  background: var(--border);
  color: var(--white);
}

.nav-user-menu button.signout-btn {
  color: #ff5f57;
}

.nav-user-menu button.signout-btn:hover {
  background: rgba(255,95,87,0.1);
  color: #ff5f57;
}

/* Loading state */
.auth-google-btn.loading {
  opacity: 0.65;
  pointer-events: none;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .auth-modal {
    padding: 28px 20px 24px;
  }
  .auth-headline h2 { font-size: 22px; }
}
