/* =================================================================
   Fire Tracker — Auth UI styles (modal + header chip)
   Designed to blend with the existing dark UI in index.css
   ================================================================= */

/* ── Interventions button lock badge ─────────────────────────── */
/* The button is locked by default (HTML has class "iv-locked").
   auth.js removes that class once the user is signed-in AND approved. */
#btn-interventions { position: relative; }
.iv-lock-badge {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fbbf24;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1.5px rgba(251, 191, 36, 0.55);
  pointer-events: none;
}
#btn-interventions.iv-locked .iv-lock-badge { display: inline-flex; }
.iv-lock-badge svg { display: block; }

/* ── Header chip ──────────────────────────────────────────────── */
#auth-user-chip {
  display: flex;
  align-items: center;
  margin-right: 12px;
  position: relative;
  font-family: 'Inter', sans-serif;
}

.auth-chip-btn {
  background: #ff5f05;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(255, 95, 5, 0.25);
}
.auth-chip-btn:hover {
  background: #f55600;
  box-shadow: 0 4px 10px rgba(255, 95, 5, 0.35);
}
.auth-chip-btn:active { transform: scale(0.98); }

.auth-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.auth-chip:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Avatar with user's initials (replaces the old status dot in the chip) */
.auth-chip-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7a26, #ff5f05);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.auth-chip-name {
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.auth-chip-caret {
  color: #6b7280;
  margin-left: 2px;
  transition: transform 0.15s;
}
.auth-chip[aria-expanded="true"] .auth-chip-caret { transform: rotate(180deg); }

/* ── Dropdown menu (white card style, matches the auth modal) ── */
.auth-chip-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 280px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18),
              0 4px 14px rgba(0, 0, 0, 0.08);
  z-index: 9999;
  color: #111827;
  overflow: hidden;
  animation: auth-pop-in 0.16s ease-out;
}
.auth-chip-menu.hidden { display: none; }

.auth-chip-menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid #f3f4f6;
}
.auth-chip-menu-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7a26, #ff5f05);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-chip-menu-meta { min-width: 0; flex: 1; }
.auth-chip-menu-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.auth-chip-menu-email {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Status pill (Approved / Pending / Admin) */
.auth-chip-pills {
  padding: 12px 16px 4px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.auth-chip-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid;
}
.auth-chip-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.auth-chip-pill.ok {
  background: #ecfdf5; border-color: #a7f3d0; color: #047857;
}
.auth-chip-pill.pending {
  background: #fff7ed; border-color: #fed7aa; color: #c2410c;
}
.auth-chip-pill.admin {
  background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8;
}

.auth-chip-actions {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.auth-chip-link {
  background: none;
  border: none;
  color: #374151;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.12s, color 0.12s;
}
.auth-chip-link:hover { background: #f3f4f6; color: #111827; }
.auth-chip-link svg { color: #9ca3af; flex-shrink: 0; }
.auth-chip-link:hover svg { color: #4b5563; }
.auth-chip-link.danger { color: #b91c1c; }
.auth-chip-link.danger:hover { background: #fef2f2; color: #991b1b; }
.auth-chip-link.danger svg { color: #f87171; }
.auth-chip-link.danger:hover svg { color: #dc2626; }

/* ── Modal backdrop ──────────────────────────────────────────── */
.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 18, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: 'Inter', sans-serif;
  animation: auth-fade-in 0.18s ease-out;
}
.auth-modal.hidden { display: none; }

@keyframes auth-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes auth-pop-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.auth-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 38px 36px 30px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35),
              0 4px 16px rgba(0, 0, 0, 0.15);
  color: #1f2937;
  position: relative;
  animation: auth-pop-in 0.22s ease-out;
}

/* ── Close button (X) ───────────────────────────────────────── */
.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f3f4f6;
  border: none;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.auth-close:hover { background: #e5e7eb; color: #111827; }

/* ── Header (logo + title + subtitle) ──────────────────────── */
.auth-header {
  text-align: center;
  margin-bottom: 24px;
}
.auth-header-logo {
  height: 36px;
  width: auto;
  margin: 0 auto 14px;
  display: block;
}
.auth-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #111827;
  letter-spacing: -0.01em;
}
.auth-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

/* ── Form ────────────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.auth-label input {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #111827;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 400;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-label input::placeholder { color: #9ca3af; }
.auth-label input:hover { border-color: #d1d5db; }
.auth-label input:focus {
  outline: none;
  border-color: #ff5f05;
  box-shadow: 0 0 0 3px rgba(255, 95, 5, 0.15);
}

.auth-help {
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.5;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 10px 12px;
}

.auth-error {
  color: #b91c1c;
  font-size: 13px;
  min-height: 0;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 9px 12px;
  line-height: 1.4;
  display: none;
}
.auth-error.show { display: block; }

.auth-btn {
  border: none;
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
  margin-top: 6px;
}
.auth-btn:active { transform: scale(0.99); }

.auth-btn-primary {
  background: #ff5f05;
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 95, 5, 0.28);
}
.auth-btn-primary:hover {
  background: #f55600;
  box-shadow: 0 6px 16px rgba(255, 95, 5, 0.36);
}
.auth-btn-primary:disabled {
  background: #fbcaa4;
  cursor: not-allowed;
  box-shadow: none;
}

/* Inline ghost link button (used for "Forgot password?") */
.auth-link {
  background: none;
  border: none;
  color: #ff5f05;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
  font-family: inherit;
  text-align: left;
  align-self: flex-start;
}
.auth-link:hover { text-decoration: underline; }

/* Bottom footer: "Already have an account? Sign in" */
.auth-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 13.5px;
  color: #6b7280;
}
.auth-footer .auth-footer-link {
  background: none;
  border: none;
  color: #ff5f05;
  font-weight: 700;
  cursor: pointer;
  padding: 0 0 0 4px;
  font-family: inherit;
  font-size: inherit;
}
.auth-footer .auth-footer-link:hover { text-decoration: underline; }

/* ── Status banners (pending / success / error message screens) ─ */
.auth-status {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  line-height: 1.55;
}
.auth-status strong { display: block; margin-bottom: 6px; font-size: 15px; }
.auth-status p { margin: 0; font-size: 13.5px; }

.auth-status-info {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}
.auth-status-info strong { color: #7c2d12; }

.auth-status-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}
.auth-status-success strong { color: #065f46; }

.auth-status-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.auth-status-error strong { color: #991b1b; }
