/* ── AUTH OVERLAY ── */
#auth-overlay {
  position: fixed;
  inset: 0;
  background: url('/assets/authbg.png') center center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#auth-box {
  width: 380px;
  background: linear-gradient(180deg, #1e1508, #120e04);
  border: 1px solid #5a3e14;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 0 60px rgba(0,0,0,0.8), 0 0 30px rgba(200,150,10,0.08);
  position: relative;
}

#auth-box::before {
  content: '';
  position: absolute;
  top: -1px; left: 20%; right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(200,150,10,0.5), transparent);
}

#auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}

#auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(90,62,20,0.4);
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: #7a6040;
  font-family: 'IM Fell English', serif;
  font-size: 0.88rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab:hover { color: #c0a060; }
.auth-tab.active {
  color: #f0c040;
  border-bottom-color: #f0c040;
}

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.auth-field {
  margin-bottom: 1rem;
}

.auth-field label {
  display: block;
  font-family: 'IM Fell English', serif;
  font-size: 0.72rem;
  color: #907040;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.auth-field input {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid #4a3210;
  border-radius: 4px;
  color: #e8d090;
  font-family: 'IM Fell English', serif;
  font-size: 0.9rem;
  padding: 0.55rem 0.8rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.auth-field input:focus {
  border-color: #8a6020;
  box-shadow: 0 0 0 2px rgba(200,150,10,0.1);
}

.auth-field input::placeholder { color: #4a3a20; font-style: italic; }

.auth-error {
  color: #c04040;
  font-size: 0.78rem;
  font-style: italic;
  margin-bottom: 0.75rem;
  padding: 0.4rem 0.6rem;
  background: rgba(139,32,32,0.1);
  border: 1px solid rgba(139,32,32,0.3);
  border-radius: 3px;
}

.auth-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, #4a3010, #2e1c08);
  border: 1px solid #7a5520;
  border-radius: 4px;
  color: #f0e0b0;
  font-family: 'IM Fell English', serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 0.25rem;
}

.auth-btn:hover {
  border-color: #f0c040;
  color: #f0c040;
  background: linear-gradient(180deg, #5a3a14, #3a2010);
}

.auth-btn:active { transform: scale(0.98); }

/* Top-bar username + logout */
#user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: #907040;
}

#user-badge .ub-name {
  color: #f0c040;
  font-weight: bold;
}

.logout-btn {
  background: none;
  border: 1px solid rgba(90,62,20,0.4);
  border-radius: 3px;
  color: #7a6040;
  font-family: 'IM Fell English', serif;
  font-size: 0.62rem;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
  transition: all 0.15s;
}

.logout-btn:hover { border-color: #c04040; color: #c04040; }

/* Save status */
.cloud-save-indicator {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.62rem;
  color: #5a4a28;
  font-style: italic;
}

.cloud-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #4a3e20;
  transition: all 0.3s;
}

.cloud-save-indicator.saving .cloud-dot { background: #f0c040; box-shadow: 0 0 5px #f0c040; }
.cloud-save-indicator.saved  .cloud-dot { background: #5aa040; }
.cloud-save-indicator.error  .cloud-dot { background: #c04040; }
