/* css/auth.css */

/* ══════════════════════════════════════
   AUTH BUTTON (Header)
   ══════════════════════════════════════ */
.auth-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.25s ease;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.auth-btn>img,
.auth-btn-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 0;
  filter: invert(1) brightness(2);
  transition: transform 0.2s ease, filter 0.2s ease;
  display: block;
}

.auth-btn.logged-in .auth-btn-icon {
  filter: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.auth-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-btn.logged-in {
  border: 2px solid var(--accent, #667eea);
}

/* ══════════════════════════════════════
   UTILITY: hidden
   ══════════════════════════════════════ */
.hidden {
  display: none !important;
}

/* ══════════════════════════════════════
   USER PANEL (Popover)
   ══════════════════════════════════════ */
.user-panel {
  position: fixed;
  top: 60px;
  right: 20px;
  width: 280px;
  background: var(--bg-container, #ffffff);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 0;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.97);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  overflow: hidden;
}

.user-panel.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ══════════════════════════════════════
   VISTA: PERFIL (usuario logueado)
   ══════════════════════════════════════ */
.user-panel-profile {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.user-avatar-large {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 2.5px solid var(--accent, #667eea);
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  width: 100%;
}

.user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main, #2d3748);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.user-email {
  font-size: 0.78rem;
  color: var(--text-muted, #718096);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  text-align: center;
}

/* Botón logout */
.btn-logout {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--bg-filters, rgba(0, 0, 0, 0.02));
  color: var(--text-main, #4a5568);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 4px;
}

.btn-logout:hover {
  background: rgba(220, 53, 69, 0.06);
  color: #dc3545;
  border-color: rgba(220, 53, 69, 0.2);
}

.btn-logout svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   VISTA: INVITADO (formulario login)
   ══════════════════════════════════════ */
#authGuestView {
  padding: 20px;
}

.auth-panel-title {
  margin: 0 0 16px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main, #2d3748);
  text-align: center;
}

/* Campos de input */
.auth-field {
  margin-bottom: 10px;
}

.auth-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-main, #2d3748);
  background: var(--bg-container, #fff);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: var(--accent, #667eea);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-input::placeholder {
  color: var(--text-muted, #a0aec0);
  font-size: 0.84rem;
}

/* Error message */
.auth-error {
  color: #e53e3e;
  font-size: 0.8rem;
  margin: 6px 0 10px;
  padding: 8px 10px;
  background: rgba(229, 62, 62, 0.06);
  border-radius: 8px;
  border-left: 3px solid #e53e3e;
}

/* Submit button */
.btn-email-submit {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: var(--accent, #667eea);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-email-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-email-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Links row */
.auth-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.auth-link {
  font-size: 0.78rem;
  color: var(--accent, #667eea);
  text-decoration: none;
  transition: opacity 0.2s;
}

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

.auth-link-sep {
  color: var(--text-muted, #cbd5e0);
  font-size: 0.78rem;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, #e2e8f0);
}

.auth-divider span {
  font-size: 0.75rem;
  color: var(--text-muted, #a0aec0);
  white-space: nowrap;
}

/* Google button */
.btn-google {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border, #e2e8f0);
  background: var(--bg-container, #fff);
  color: var(--text-main, #4a5568);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-google:hover:not(:disabled) {
  background: var(--bg-filters, rgba(0, 0, 0, 0.02));
  border-color: var(--text-muted, #a0aec0);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.btn-google:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

/* ══════════════════════════════════════
   FORGOT PASSWORD SECTION
   ══════════════════════════════════════ */
#authForgotSection {
  /* Inherits padding from #authGuestView */
}

.auth-forgot-hint {
  font-size: 0.82rem;
  color: var(--text-muted, #718096);
  margin: 0 0 12px;
  line-height: 1.45;
  text-align: center;
}

.auth-forgot-msg {
  font-size: 0.8rem;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 8px;
}

.auth-forgot-msg.auth-error {
  color: #e53e3e;
  background: rgba(229, 62, 62, 0.06);
  border-left: 3px solid #e53e3e;
}

.auth-forgot-msg.auth-success {
  color: #38a169;
  background: rgba(56, 161, 105, 0.06);
  border-left: 3px solid #38a169;
}

/* ══════════════════════════════════════
   DARK THEME
   ══════════════════════════════════════ */
[data-theme="dark"] .user-panel {
  background: var(--bg-container, #1a202c);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  border-color: var(--border, #2d3748);
}

[data-theme="dark"] .auth-input {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border, #4a5568);
  color: var(--text-main, #e2e8f0);
}

[data-theme="dark"] .auth-input:focus {
  border-color: var(--accent, #667eea);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .btn-google {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border, #4a5568);
  color: var(--text-main, #e2e8f0);
}

[data-theme="dark"] .btn-google:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .auth-btn>img,
[data-theme="dark"] .auth-btn-icon {
  filter: invert(1) brightness(2);
}

[data-theme="dark"] .auth-btn.logged-in .auth-btn-icon {
  filter: none;
}

[data-theme="dark"] .btn-logout:hover {
  background: rgba(255, 100, 100, 0.1);
  color: #ff7070;
  border-color: rgba(255, 100, 100, 0.2);
}

/* TEST - eliminado */