/* ==========================================================================
   Auth Modal Styles (Login / Subscribe)
   ========================================================================== */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10200; /* Higher than newsletter modal (10100) */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  font-family: var(--font-ui), system-ui, -apple-system, sans-serif;
}

.auth-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
}

.auth-modal__container {
  position: relative;
  width: 90%;
  max-width: 480px;
  background-color: var(--cookie-bg, #ffffff);
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 10201;
  overflow: hidden;
  transform: scale(0.95) translateY(15px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--cookie-border, #e2e8f0);
}

.auth-modal.active .auth-modal__container {
  transform: scale(1) translateY(0);
}

.auth-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.05);
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--cookie-text-muted, #64748b);
  transition: all 0.2s ease;
  line-height: 1;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

[data-theme="dark"] .auth-modal__close {
  background: rgba(255, 255, 255, 0.05);
}

.auth-modal__close:hover {
  color: var(--accent-red, #dc2626);
  background: rgba(220, 38, 38, 0.1);
  transform: rotate(90deg);
}

/* Tabs */
.auth-modal__tabs {
  display: flex;
  border-bottom: 1px solid var(--cookie-border, #e2e8f0);
  background-color: var(--bg-accent, #f8fafc);
}

.auth-modal__tab {
  flex: 1;
  background: none;
  border: none;
  padding: 16px 20px;
  font-family: var(--font-ui), sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--cookie-text-muted, #64748b);
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  text-align: center;
}

.auth-modal__tab.active {
  color: var(--accent-red, #dc2626);
  border-bottom-color: var(--accent-red, #dc2626);
  background-color: var(--cookie-bg, #ffffff);
}

.auth-modal__tab:focus-visible {
  outline: 2px solid var(--accent-red, #dc2626);
  outline-offset: -2px;
}

/* Body */
.auth-modal__body {
  padding: 30px;
}

.auth-modal__panel {
  display: none;
}

.auth-modal__panel.active {
  display: block;
}

.auth-modal__title {
  font-family: var(--font-ui), sans-serif;
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 8px 0;
  color: var(--cookie-text, #1e293b);
}

.auth-modal__subtitle {
  font-size: 13px;
  line-height: 1.5;
  color: var(--cookie-text-muted, #64748b);
  margin: 0 0 24px 0;
}

/* Forms */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.auth-form label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cookie-text, #1e293b);
}

.auth-form .form-control {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-ui), sans-serif;
  font-size: 14px;
  background-color: var(--bg-accent, #f8fafc);
  border: 1px solid var(--cookie-border, #e2e8f0);
  border-radius: 6px;
  color: var(--cookie-text, #1e293b);
  outline: none;
  transition: all 0.2s ease;
  min-height: 40px;
}

.auth-form .form-control:focus {
  border-color: var(--accent-red, #dc2626);
  background-color: var(--bg-secondary, #ffffff);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.auth-error-msg {
  display: block;
  font-size: 11px;
  color: var(--accent-red, #dc2626);
  font-weight: 600;
}

.auth-form__options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-top: 4px;
}

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-weight: 500 !important;
  color: var(--cookie-text-muted, #64748b) !important;
}

.auth-checkbox input {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-red, #dc2626);
}

.auth-link {
  color: var(--accent-red, #dc2626);
  text-decoration: none;
  font-weight: 600;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-submit-btn {
  margin-top: 10px;
  width: 100%;
  font-size: 14px;
}

/* User profile widget inside headers */
.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-ui), sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  margin-left: 15px;
}

.user-greeting {
  font-weight: 500;
  color: var(--text-secondary);
}

.user-greeting strong {
  font-weight: 700;
  color: var(--text-primary);
}

.logout-btn {
  background: none;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  font-family: var(--font-ui), sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  border-radius: var(--border-radius-sm, 4px);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  background-color: var(--bg-accent);
  border-color: var(--text-secondary);
}

/* Mobile drawer user profile */
.drawer-user-profile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 10px 0;
  border-top: 1px solid var(--cookie-border);
  margin-top: 10px;
}

.drawer-user-profile .user-greeting {
  font-size: 14px;
  color: var(--text-primary);
}

.drawer-user-profile .logout-btn {
  width: 100%;
  min-height: 44px;
  font-size: 14px;
  background-color: var(--bg-accent);
}

/* Hide header profile menu on mobile */
@media (max-width: 991px) {
  .user-profile-menu {
    display: none !important;
  }
}
