/* ============================================================
   AVÍSAME PORFA — Auth & Modal Stylesheet
   ============================================================ */

/* ── Header Auth ─────────────────────────────────────────────── */
.header-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}

#auth-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── User Info (logged in) ───────────────────────────────────── */
.user-info-content {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-details {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* ── Plan Badge ──────────────────────────────────────────────── */
.plan-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 3px;
}

.plan-badge--pro {
  background: rgba(232, 184, 75, 0.15);
  color: var(--gold);
  border: 1px solid rgba(232, 184, 75, 0.35);
}

.plan-badge--free {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ── Upgrade CTA Button (header, free users) ─────────────────── */
.btn-upgrade-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(232, 184, 75, 0.12);
  border: 1px solid rgba(232, 184, 75, 0.4);
  border-radius: 20px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.btn-upgrade-cta:hover {
  background: rgba(232, 184, 75, 0.22);
  border-color: rgba(232, 184, 75, 0.65);
}

/* ── User Dropdown ───────────────────────────────────────────── */
.user-dropdown {
  position: relative;
  display: inline-block;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 6px;
  border: 2px solid var(--border-gold);
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}

.user-dropdown:hover .dropdown-content { display: block; }

.dropdown-content a {
  color: var(--text-secondary);
  padding: 11px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.85rem;
  transition: background var(--transition), color var(--transition);
}

.dropdown-content a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ── Modal Backdrop ──────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(2, 5, 12, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: backdropIn 0.2s ease;
  overflow-y: auto;
  padding: 24px 16px;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Modal Content ───────────────────────────────────────────── */
.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  animation: modalSlideIn 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(232,184,75,0.04);
  overflow: hidden;
}

@keyframes modalSlideIn {
  from { transform: translateY(-28px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0)      scale(1);    opacity: 1; }
}

/* ── Modal Header ────────────────────────────────────────────── */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 80% 120% at 50% -10%, rgba(232,184,75,0.05) 0%, transparent 70%),
    var(--bg-surface);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.close {
  color: var(--text-muted);
  font-size: 1.4rem;
  font-weight: 300;
  cursor: pointer;
  line-height: 1;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ── Modal Body ──────────────────────────────────────────────── */
.modal-body { padding: 28px; }

/* ── Modal Footer ────────────────────────────────────────────── */
.modal-footer {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.modal-footer p {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal-footer a {
  color: var(--cyan);
  font-weight: 500;
}

.modal-footer a:hover { text-decoration: underline; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-group input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}

.form-group input::placeholder { color: var(--text-muted); }

.form-group input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

/* Full-width button variant */
.full-width {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 0.92rem;
  border-radius: var(--radius-md);
}

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.divider span {
  background: var(--bg-surface);
  padding: 0 14px;
  color: var(--text-muted);
  font-size: 0.8rem;
  position: relative;
}

/* ── Google Sign-In Button (custom overlay) ──────────────────── */
.google-btn-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.google-btn-face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  pointer-events: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  box-sizing: border-box;
}

.google-btn-wrap:hover .google-btn-face {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
  color: var(--text-primary);
}

.google-btn-native {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  display: flex;
  align-items: stretch;
}

.google-btn-native > div,
.google-btn-native iframe {
  width: 100% !important;
  height: 100% !important;
  flex: 1;
}

/* ── Password Input with Eye Toggle ──────────────────────────── */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  flex: 1;
  padding-right: 44px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
  font-size: 0.85rem;
}

.toggle-password:hover { color: var(--gold); }

/* ── Password Requirements Checklist ─────────────────────────── */
.password-requirements {
  margin-top: 8px;
  font-size: 0.78rem;
}

.password-requirements ul {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.password-requirements li {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition);
}

.password-requirements li::before {
  content: '○';
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: color var(--transition);
  flex-shrink: 0;
}

.password-requirements li.ok {
  color: var(--green);
}

.password-requirements li.ok::before {
  content: '●';
  color: var(--green);
}

/* ── Watchlist Stats ─────────────────────────────────────────── */
.watchlist-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Auth Prompt ─────────────────────────────────────────────── */
.auth-prompt { margin: 16px 0; }

/* ── Loading States ──────────────────────────────────────────── */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7,11,20,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
}

.loading-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .header-auth { width: 100%; justify-content: flex-end; }

  .modal {
    padding: 16px 12px;
    align-items: flex-end;
  }

  .modal-content {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-width: 100%;
    margin: 0;
    width: 100%;
  }

  .modal-body { padding: 20px; }
  .modal-header { padding: 18px 20px; }

  .watchlist-header { flex-direction: column; }
}
