/* =============================================
   SMART CITY — Auth Styles (auth.css)
   ============================================= */

/* === NAVBAR AUTH AREA === */
#nav-auth-area {
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.nav-auth-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.nav-auth-btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-auth-btn--ghost:hover {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.3);
}

.nav-auth-btn--primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.3);
}

.nav-auth-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(59, 130, 246, 0.5);
}

/* === NAV USER MENU === */
.nav-user-menu {
  position: relative;
}

.nav-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 10px;
  padding: 5px 12px 5px 5px;
  cursor: pointer;
  transition: all 0.25s;
  font-family: 'Inter', sans-serif;
}

.nav-avatar-btn:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
}

.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-username {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f1f5f9;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: rgba(14, 20, 38, 0.97);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(59, 130, 246, 0.06);
  backdrop-filter: blur(24px);
  padding: 8px;
  z-index: 999;
  animation: authDropIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-dropdown--open {
  display: block;
}

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

.nav-dropdown-header {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-dropdown-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f1f5f9;
}

.nav-dropdown-email {
  font-size: 0.75rem;
  color: #64748b;
}

.nav-dropdown-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin: 0 4px 4px;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  border-radius: 9px;
  color: #94a3b8;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.nav-dropdown-item:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #f1f5f9;
}

.nav-dropdown-item--danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* === AUTH MODAL OVERLAY === */
.auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.auth-modal--open {
  display: flex;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.75);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.auth-modal__box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  margin: 20px;
  background: linear-gradient(160deg, #111827 0%, #0f172a 100%);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 24px;
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 36px 36px 32px;
  animation: authModalIn 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
  overflow: hidden;
}

.auth-modal__box::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 120px;
  background: radial-gradient(ellipse, rgba(59, 130, 246, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

@keyframes authModalIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #64748b;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.auth-modal__close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* === MODAL HEADER === */
.auth-modal__header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-modal__icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(99, 102, 241, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #3b82f6;
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.15);
}

.auth-modal__icon--signup {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.15));
  border-color: rgba(139, 92, 246, 0.25);
  color: #8b5cf6;
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.15);
}

.auth-modal__header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.auth-modal__header p {
  font-size: 0.875rem;
  color: #64748b;
}

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

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-field label i {
  color: #3b82f6;
  font-size: 0.75rem;
  width: 14px;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #f1f5f9;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.25s;
}

.auth-input-wrap input::placeholder {
  color: #334155;
}

.auth-input-wrap input:focus {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.auth-input-wrap--pw input {
  padding-right: 42px;
}

.auth-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #475569;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px;
  transition: color 0.2s;
}

.auth-pw-toggle:hover { color: #3b82f6; }

/* Error state */
.auth-input--error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.auth-field-error {
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 2px;
}

/* === SUBMIT BUTTON === */
.auth-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
  margin-top: 4px;
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.5);
}

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

.auth-submit-btn--signup {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}

.auth-submit-btn--signup:hover {
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.5);
}

/* === SWITCH LINK === */
.auth-switch {
  text-align: center;
  font-size: 0.82rem;
  color: #475569;
  margin-top: 18px;
}

.auth-switch-btn {
  background: none;
  border: none;
  color: #3b82f6;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: 'Inter', sans-serif;
  transition: color 0.2s;
}

.auth-switch-btn:hover { color: #6366f1; text-decoration: underline; }

/* === PROFILE MODAL === */
.auth-modal__box--profile {
  max-width: 420px;
}

.auth-profile-hero {
  text-align: center;
  margin-bottom: 20px;
}

.auth-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 32px rgba(59, 130, 246, 0.3);
  border: 3px solid rgba(59, 130, 246, 0.3);
}

.auth-profile-initials {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
}

.auth-profile-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.auth-profile-email {
  font-size: 0.82rem;
  color: #64748b;
}

.auth-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 0.8rem;
  color: #64748b;
}

.auth-profile-meta i {
  color: #3b82f6;
  width: 14px;
}

.auth-profile-meta strong {
  color: #94a3b8;
}

/* === TOAST === */
.auth-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 12px 24px;
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  z-index: 9999;
  white-space: nowrap;
  transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.auth-toast--show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.auth-toast--success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.9));
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
}

.auth-toast--error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
}

.auth-toast--info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(99, 102, 241, 0.9));
  border: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
  .auth-modal__box {
    padding: 28px 22px 26px;
    border-radius: 20px;
  }
  .nav-auth-btn span,
  .nav-username { display: none; }
  .nav-auth-btn { padding: 7px 10px; }
  .auth-toast { font-size: 0.8rem; padding: 10px 18px; }
}
