/* ========================================
   AUTH UI COMPONENTS
   Modal, banner, account menu, user indicator
   ======================================== */

/* Modal overlay */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 34, 53, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.auth-modal-overlay.open {
  opacity: 1;
}

.auth-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(27, 34, 53, 0.2);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s var(--ease);
}

.auth-modal-overlay.open .auth-modal {
  transform: translateY(0);
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted-light);
  transition: all 0.2s var(--ease);
}

.auth-modal-close:hover {
  background: var(--border-light);
  color: var(--text-dark);
}

.auth-modal-content {
  padding: 40px 32px 32px;
}

.auth-modal-badge {
  display: inline-block;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.auth-modal-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 10px;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.auth-modal-subtitle {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 24px;
}

.auth-modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.auth-modal-input {
  width: 100%;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-dark);
  background: var(--white);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.auth-modal-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.auth-modal-submit {
  width: 100%;
  padding: 14px 20px;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}

.auth-modal-submit:hover:not(:disabled) {
  background: var(--orange-hover);
}

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

.auth-modal-submit-spinner svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-modal-status {
  font-size: 13px;
  margin-bottom: 16px;
  min-height: 18px;
  color: var(--muted);
}

.auth-modal-status-error {
  color: #d63031;
}

.auth-modal-skip {
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.auth-modal-skip:hover {
  color: var(--text-dark);
}

.auth-modal-reassure {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted-light);
  justify-content: center;
}

.auth-modal-success {
  text-align: center;
  padding: 20px 0;
}

.auth-modal-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: var(--success-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
}

.auth-modal-help {
  font-size: 13px;
  color: var(--muted-light);
  margin-top: 12px;
  margin-bottom: 20px;
}

/* ========================================
   TOPBAR USER INDICATOR
   ======================================== */

.topbar-btn-user {
  background: var(--light-blue-bg) !important;
  border-color: var(--border) !important;
  color: var(--text-dark) !important;
  max-width: 180px;
}

.auth-user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

/* ========================================
   ACCOUNT MENU DROPDOWN
   ======================================== */

.auth-account-menu {
  position: fixed;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(27, 34, 53, 0.12);
  min-width: 240px;
  z-index: 60;
  overflow: hidden;
}

.auth-account-menu-header {
  padding: 14px 16px;
}

.auth-account-menu-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-light);
  margin-bottom: 4px;
}

.auth-account-menu-email {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-account-menu-divider {
  height: 1px;
  background: var(--border-light);
}

.auth-account-menu-item {
  width: 100%;
  background: transparent;
  border: none;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dark);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.auth-account-menu-item:hover {
  background: var(--light-blue-bg);
}

.auth-account-menu-item svg {
  color: var(--muted);
  flex-shrink: 0;
}

.auth-account-menu-item:last-child svg {
  color: var(--muted-light);
}

/* ========================================
   WELCOME BACK BANNER
   ======================================== */

.welcome-back-banner {
  background: linear-gradient(135deg, var(--blue-soft) 0%, var(--orange-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 32px;
  animation: slideDown 0.4s var(--ease);
}

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

.welcome-back-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.welcome-back-content > svg {
  color: var(--orange);
  flex-shrink: 0;
}

.welcome-back-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.welcome-back-sub {
  font-size: 13px;
  color: var(--muted);
}

.welcome-back-btn {
  margin-left: auto;
  padding: 8px 16px;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s var(--ease);
  white-space: nowrap;
}

.welcome-back-btn:hover {
  background: var(--orange-hover);
}

.welcome-back-close {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}

.welcome-back-close:hover {
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-dark);
}

/* Mobile */
@media (max-width: 640px) {
  .welcome-back-content {
    flex-wrap: wrap;
  }

  .welcome-back-btn {
    width: 100%;
    margin-left: 0;
    padding: 10px;
    order: 3;
  }

  .auth-modal-content {
    padding: 32px 22px 24px;
  }

  .auth-modal-title {
    font-size: 22px;
  }
}
