/* ===============================
   GLOBAL SHELL / APP FRAME
=============================== */

:root {
  --z-base: 1;
  --z-footer: 10;
  --z-sidebar: 30;
  --z-bottom-nav: 9998;
  --z-loader: 10000;
  --z-modal: 99999;
  --z-modal-top: 100000;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html,
body {
  width: 100%;
  min-height: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body.modal-open,
body.create-modal-open {
  overflow: hidden !important;
  position: fixed !important;
  inset: 0;
  width: 100%;
}

#app,
.app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0 !important;
}


.event-modal {
  z-index: 5000 !important;
}

#organizerProfileModal {
  z-index: 4000 !important;
}
.page {
  width: 100%;
  margin: 0;
  padding: 0 !important;
  animation: pageFadeIn 0.28s cubic-bezier(.2, .8, .2, 1);
  will-change: transform, opacity;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .page {
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

/* ===============================
   FOOTER
=============================== */

#footer-root {
  position: relative !important;
  z-index: var(--z-footer) !important;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .25s ease;
}

#footer-root.footer-hidden {
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}

/* ===============================
   PAGE LOADER
=============================== */

#pageLoader {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-loader);
  transition: opacity .35s ease;
}

#pageLoader.hide {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.loader-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #e5e5e5;
  border-top: 3px solid #000;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===============================
   BOTTOM NAV
=============================== */

body.notifications-page-open .bottom-nav {
  transform: translateX(-50%) translateY(120%);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition:
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 120ms ease,
    visibility 0s linear 180ms;
}
.bottom-nav {
  transition:
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 140ms ease,
    visibility 0s linear 180ms;
  will-change: transform, opacity;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(10px + var(--safe-bottom));
  width: min(980px, calc(100% - 16px));
  background: linear-gradient(to top, rgba(199, 199, 199, 0.98), rgba(121, 121, 121, 0.88));
  border: 1px solid rgba(255,255,255,.06);
  border-bottom: 0;
  border-radius: 22px 22px 18px 18px;
  box-shadow:
    0 18px 50px rgba(0,0,0,.38),
    inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 10px calc(12px + var(--safe-bottom));
  overflow: hidden;
  isolation: isolate;
  z-index: var(--z-bottom-nav);
}

.bottom-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(0,190,190,.10), transparent 30%),
    linear-gradient(to top, rgba(255,255,255,.03), transparent 32%);
  pointer-events: none;
}

#bottomNav {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  z-index: var(--z-bottom-nav);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .25s ease;
}

#bottomNav.nav-hidden {
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}

#bottomNav .nav-indicator {
  position: absolute;
  left: 0;
  top: 9px;
  height: calc(100% - 18px);
  width: 56px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.16), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  box-shadow:
    0 10px 28px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.08);
  opacity: 0;
  transform: translateX(0) scale(.92);
  transition:
    transform .42s cubic-bezier(.2,.9,.2,1),
    width .42s cubic-bezier(.2,.9,.2,1),
    opacity .18s ease;
  pointer-events: none;
  z-index: 0;
}

#bottomNav.has-active .nav-indicator {
  opacity: 1;
}

.nav-item {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  position: relative;
  cursor: pointer;
  border: none;
  background: transparent;
  z-index: 1;
  transition:
    transform .22s ease,
    color .25s ease,
    opacity .25s ease,
    box-shadow .25s ease;
  will-change: transform;
  text-decoration: none;
}

.nav-item::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 18%, rgba(0,190,190,.22), transparent 62%);
  opacity: 0;
  transform: scale(.86);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s ease, filter .25s ease;
}

.nav-item:hover {
  color: #fff;
  transform: translateY(-1px);
}

.nav-item:hover::before {
  opacity: 1;
  transform: scale(1);
}

.nav-item:active {
  transform: translateY(0) scale(.96);
}

.nav-item.active {
  color: #00bebe;
  transform: translateY(-2px);
}

.nav-item.active::before {
  opacity: 1;
  transform: scale(1);
}

.nav-item.active svg {
  animation: navIconPop .42s cubic-bezier(.2,.9,.2,1);
}

@keyframes navIconPop {
  0%   { transform: scale(.84) rotate(-6deg); }
  60%  { transform: scale(1.12) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

.label {
  font-size: 10px !important;
  line-height: 1;
  opacity: 1;
  transition: opacity .25s ease, transform .25s ease;
}

.nav-item.active .label {
  animation: navLabelRise .42s cubic-bezier(.2,.9,.2,1);
}

@keyframes navLabelRise {
  0%   { opacity: .35; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

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

.create-btn svg {
  background: #ff2e63;
  padding: 8px;
  border-radius: 50%;
  stroke: #fff;
  box-shadow: 0 10px 20px rgba(255,46,99,.25);
}

.create-btn:hover {
  transform: translateY(-2px);
}

.profile-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, #111, #333);
  color: #fff;
  letter-spacing: .5px;
  text-transform: uppercase;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
  position: relative;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.profile-avatar svg {
  width: 18px;
  height: 18px;
  opacity: .9;
}

.profile-avatar.is-user {
  background: #ddd;
  color: #111;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.nav-item.active .profile-avatar {
  transform: scale(1.08);
  box-shadow:
    0 0 0 2px #000,
    0 6px 18px rgba(0,0,0,0.25);
}

.nav-item:hover .profile-avatar {
  transform: scale(1.06);
}

.profile-avatar:not(.is-user) {
  background: linear-gradient(135deg, #000, #222);
  color: #fff;
}

.profile-avatar.is-user::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c6ff, #0072ff);
  z-index: -1;
  opacity: 0;
  transition: opacity .25s ease;
}

.nav-item.active .profile-avatar.is-user::after {
  opacity: 1;
}

/* ===============================
   DESKTOP SIDEBAR
=============================== */

.sidebar {
  display: none;
}

@media (min-width: 992px) {
  .bottom-nav {
    display: none !important;
  }

  .app-shell {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 100vh;
  }

  .sidebar {
    display: flex;
    flex: 0 0 88px;
    width: 88px;
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: flex-start;
    z-index: var(--z-sidebar);
    background: rgba(255, 255, 255, 0.94);
    border-right: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: 0 2px 20px rgba(16, 24, 40, 0.03);
    flex-direction: column;
    align-items: center;
    padding: 14px 10px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .sidebar .logo {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, #0a66c2, #004182);
    box-shadow: 0 10px 18px rgba(10, 102, 194, 0.22);
    margin-bottom: 16px;
    flex: 0 0 auto;
  }

  .side-nav,
  .sidebar-bottom {
    width: 100%;
    display: grid;
    gap: 10px;
  }

  .side-nav {
    flex: 1;
    align-content: start;
    margin-top: 6px;
  }

  .nav-btn,
  .profile-launcher {
    position: relative;
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    color: #344054;
    cursor: pointer;
    outline: 0;
    transition:
      transform .22s ease,
      background .22s ease,
      border-color .22s ease,
      box-shadow .22s ease,
      color .22s ease;
  }

  .nav-btn {
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
  }

  .nav-btn:hover,
  .nav-btn.active,
  .profile-launcher:hover,
  .profile-launcher.active {
    background: #f3f7fb;
    border-color: #e1e7ef;
    color: var(--accent, #0a66c2);
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(16, 24, 40, 0.05);
  }

  .nav-btn svg {
    width: 20px;
    height: 20px;
  }

  .nav-btn::after {
    content: attr(data-label);
    position: absolute;
    left: 58px;
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    white-space: nowrap;
    font-size: 0.84rem;
    font-weight: 700;
    color: #101828;
    background: #fff;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 999px;
    padding: 8px 12px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
  }

  .nav-btn:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }

  .sidebar-bottom {
    margin-top: auto;
    position: relative;
    padding-top: 12px;
  }

  .profile-wrap {
    position: relative;
    width: 100%;
  }

  .profile-launcher {
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: #f8fafc;
    border: 1px solid var(--line, #e5e7eb);
    color: #475467;
  }

  .profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    position: relative;
  }

  .profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
  }

  .profile-avatar-fallback {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
  }

  .profile-menu {
    position: absolute;
    right: -248px;
    bottom: 0;
    width: 220px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.16);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-8px) scale(.98);
    transition: opacity .18s ease, transform .18s ease;
    z-index: 50;
  }

  .profile-wrap.open .profile-menu,
  .profile-wrap:hover .profile-menu,
  .profile-wrap:focus-within .profile-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) scale(1);
  }

  .profile-menu-item {
    width: 100%;
    height: 42px;
    border: 0;
    background: transparent;
    border-radius: 12px;
    padding: 0 12px;
    text-align: left;
    font-weight: 600;
    color: #101828;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
  }

  .profile-menu-item:hover {
    background: #f3f7fb;
    transform: translateX(2px);
  }

  .profile-menu-item.danger {
    color: #b42318;
  }

  .profile-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 4px;
  }

  #app {
    flex: 1 1 auto;
    min-height: 100vh;
  }
}

@media (max-width: 991px) {
  .app-shell,
  #app,
  .page {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .sidebar {
    display: none !important;
  }

  .bottom-nav {
    display: flex;
  }
}

/* ===============================
   AUTH MODAL
=============================== */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-top) !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.auth-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
}

.auth-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(25px);
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
  transform: translateY(40px) scale(.96);
  opacity: 0;
  transition: all .3s cubic-bezier(.2, .8, .2, 1);
  position: relative;
}

.auth-modal.active .auth-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

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

.auth-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.auth-header p {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

.auth-fields input {
  width: 100%;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  outline: none;
  background: #fff;
  font-size: 14px;
  transition: .2s;
  box-sizing: border-box;
}

.auth-fields input:focus {
  border-color: #000;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  font-weight: 600;
  margin-top: 6px;
  transition: .2s;
}

.btn-primary:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.btn-outline {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #ddd;
  background: #fff;
  margin-top: 8px;
  font-weight: 500;
  transition: .2s;
}

.btn-outline:hover {
  background: #f8f8f8;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 22px 0;
  gap: 10px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e5e5;
}

.auth-divider span {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}

.auth-socials {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.social-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  cursor: pointer;
  transition: all .2s ease;
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.social-btn img {
  width: 20px;
  height: 20px;
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
}

.auth-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* ===============================
   AUTH LOADING OVERLAY
=============================== */

.auth-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-top);
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 20px;
}

.auth-loading-overlay.active {
  display: flex;
}

.auth-loading-card {
  width: min(92vw, 360px);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.28);
  text-align: center;
  transform: translateY(10px) scale(0.98);
  animation: authPopIn 0.22s ease forwards;
}

.auth-loading-spinner {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 4px solid rgba(0, 0, 0, 0.08);
  border-top-color: #000;
  animation: authSpin 0.85s linear infinite;
}

.auth-loading-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  margin: 0 0 6px;
}

.auth-loading-text {
  font-size: 13px;
  color: #666;
  margin: 0;
}

@keyframes authSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes authPopIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===============================
   LOGIN MODAL
=============================== */

.login-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: var(--z-modal);
  overflow-y: auto;
  overflow-x: hidden;
}

.login-modal.active {
  display: block;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .25s ease;
}

.login-modal.active .login-backdrop {
  opacity: 1;
}

.login-sheet {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px;
  text-align: center;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  will-change: transform;
}

.login-modal.active .login-sheet {
  transform: translateY(0);
}

.login-sheet h3 {
  color: #000;
  margin: 0 0 8px;
}

.login-sheet p {
  color: #3b3b3b;
  margin: 0;
}

.login-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.login-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: iconPop .4s ease;
}

.login-modal.active .login-icon {
  animation: iconPop .4s ease forwards;
}

.login-primary {
  margin-top: 16px;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: #006356;
  color: #fff;
  font-weight: 600;
  border: none;
}

@keyframes iconPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===============================
   GENERIC MODAL OVERLAY
=============================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  display: none;
  z-index: var(--z-modal-top) !important;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-overlay.active {
  display: flex !important;
  align-items: stretch;
  justify-content: center;
  padding: 20px;
}

.modal {
  width: 100%;
  min-height: 100%;
  height: auto;
  background: #fff;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
}

/* ===============================
   CONFIRM MODAL
=============================== */

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-top);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}

.confirm-modal[hidden] {
  display: none !important;
}

.confirm-modal.active {
  display: grid;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.confirm-card {
  position: relative;
  width: min(92vw, 380px);
  background: #fff;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
  border: 1px solid #e5e7eb;
  animation: popIn .18s ease;
}

.confirm-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: #101828;
}

.confirm-card p {
  margin: 0;
  color: #667085;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.confirm-btn {
  min-width: 92px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
}

.confirm-btn.secondary {
  background: #f2f4f7;
  color: #344054;
  border-color: #e5e7eb;
}

.confirm-btn.danger {
  background: #d92d20;
  color: #fff;
}

@keyframes popIn {
  from { transform: translateY(8px) scale(.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ===============================
   PROFILE SETUP MODAL
=============================== */

.profile-setup-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.profile-setup-modal.active {
  display: flex;
}

.profile-setup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 18, 0.72);
  backdrop-filter: blur(16px);
}

.profile-setup-sheet {
  position: relative;
  width: min(100%, 520px);
  max-height: min(92vh, 860px);
  z-index: 1;
  display: flex;
}

.profile-setup-card {
  width: 100%;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(20, 24, 35, 0.98), rgba(14, 17, 26, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.profile-setup-head {
  text-align: center;
  margin-bottom: 18px;
  flex: 0 0 auto;
}

.profile-setup-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.profile-setup-head h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.profile-setup-head p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 14px;
}

.profile-setup-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 22px;
  flex: 0 0 auto;
}

.step-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.step-dot.active {
  background: #ffffff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.08);
}

.step-line {
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.profile-setup-body {
  min-height: 260px;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.profile-setup-body::-webkit-scrollbar {
  width: 6px;
}

.profile-setup-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.profile-step {
  display: none;
  animation: profileFadeUp 0.22s ease-out;
}

.profile-step.active {
  display: block;
}

@keyframes profileFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.84);
}

.profile-input,
.profile-textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding: 0 16px;
  font-size: 15px;
  outline: none;
  transition: 0.2s ease;
}

.profile-input {
  height: 52px;
}

.profile-textarea {
  min-height: 96px;
  padding: 14px 16px;
  resize: vertical;
}

.profile-input::placeholder,
.profile-textarea::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.profile-input:focus,
.profile-textarea:focus {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.field-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.field-spacer {
  height: 16px;
}

.avatar-upload-wrap {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
}

.avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.35;
}

.profile-file-input {
  width: 100%;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.gender-grid,
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gender-chip,
.category-chip {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
  padding: 10px 12px;
  font-size: 14px;
}

.gender-chip:hover,
.category-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.gender-chip.active,
.category-chip.active {
  background: #fff;
  color: #111827;
  border-color: #fff;
}

.profile-step-processing {
  text-align: center;
  padding: 12px 4px 0;
}

.profile-spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  margin: 0 auto 16px;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: #ffffff;
  animation: profileSpin 0.9s linear infinite;
}

@keyframes profileSpin {
  to {
    transform: rotate(360deg);
  }
}

.profile-step-processing h3 {
  margin: 0;
  font-size: 18px;
}

.profile-step-processing p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 14px;
}

.profile-setup-footer {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex: 0 0 auto;
}

.profile-btn {
  flex: 1;
  height: 50px;
  border-radius: 16px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.profile-btn.primary {
  background: #ffffff;
  color: #111827;
}

.profile-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.profile-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.profile-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.profile-error {
  margin-top: 14px;
  font-size: 13px;
  color: #ffd1d1;
  background: rgba(255, 77, 77, 0.10);
  border: 1px solid rgba(255, 77, 77, 0.18);
  padding: 10px 12px;
  border-radius: 12px;
}

@media (max-width: 520px) {
  .profile-setup-modal {
    padding: 12px;
    align-items: flex-end;
  }

  .profile-setup-sheet {
    width: 100%;
    max-height: 92vh;
  }

  .profile-setup-card {
    padding: 16px 14px 14px;
    border-radius: 22px 22px 18px 18px;
  }

  .profile-setup-head {
    margin-bottom: 14px;
  }

  .profile-setup-head h2 {
    font-size: 21px;
  }

  .profile-setup-head p {
    font-size: 13px;
    line-height: 1.45;
  }

  .profile-setup-steps {
    gap: 8px;
    margin: 16px 0 16px;
  }

  .step-dot {
    width: 9px;
    height: 9px;
  }

  .step-line {
    width: 20px;
  }

  .profile-setup-body {
    min-height: 0;
    max-height: calc(92vh - 220px);
    padding-right: 2px;
  }

  .gender-grid,
  .category-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .gender-chip,
  .category-chip {
    min-height: 42px;
    font-size: 13px;
    border-radius: 12px;
    padding: 9px 11px;
  }

  .avatar-upload-wrap {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .avatar-preview {
    width: 92px;
    height: 92px;
    border-radius: 20px;
  }

  .profile-input {
    height: 48px;
    font-size: 14px;
  }

  .profile-textarea {
    min-height: 88px;
    font-size: 14px;
  }

  .profile-setup-footer {
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
  }

  .profile-btn {
    height: 46px;
    font-size: 14px;
    border-radius: 14px;
  }

  .profile-step-processing {
    padding-top: 6px;
  }

  .profile-spinner {
    width: 46px;
    height: 46px;
    margin-bottom: 12px;
  }
}

/* ===============================
   INSTALL PROMPT
=============================== */

.install-prompt[hidden] {
  display: none !important;
}

.install-prompt {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: end center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(8px);
}

.install-card {
  width: min(100%, 420px);
  background: #ffffff;
  color: #0f172a;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}

.install-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.install-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.install-card p {
  margin: 0 0 16px;
  color: #475569;
  line-height: 1.5;
}

.install-actions {
  display: flex;
  gap: 10px;
}

.install-primary,
.install-secondary {
  flex: 1;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
}

.install-primary {
  background: #000000;
  color: #fff;
}

.install-secondary {
  background: #e2e8f0;
  color: #0f172a;
}

/* ===============================
   TOAST
=============================== */

.toast-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-modal);
  pointer-events: none;
  width: min(92vw, 520px);
  display: grid;
  justify-items: center;
}

.toast {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(20, 35, 28, 0.96), rgba(8, 17, 13, 0.96));
  border: 1px solid rgba(124, 247, 177, 0.22);
  box-shadow: 0 24px 70px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.03) inset;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  opacity: 0;
  transform: translateY(-120px) scale(0.45);
  transform-origin: center top;
  will-change: width, transform, opacity, border-radius, padding;
  transition:
    width 420ms cubic-bezier(.2,.9,.2,1),
    transform 420ms cubic-bezier(.2,.9,.2,1),
    opacity 220ms ease,
    border-radius 420ms cubic-bezier(.2,.9,.2,1),
    padding 420ms cubic-bezier(.2,.9,.2,1);
}

.toast.is-showing {
  opacity: 1;
  transform: translateY(0) scale(1);
  width: 64px;
  border-radius: 50%;
  padding: 0;
}

.toast.is-expanded {
  width: min(92vw, 520px);
  border-radius: 22px;
  padding: 14px 16px 14px 14px;
  transform: translateY(0) scale(1);
  opacity: 1;
}

.toast.is-collapsing {
  width: 64px;
  border-radius: 50%;
  padding: 0;
  opacity: 0.98;
  transform: translateY(-24px) scale(0.92);
}

.toast.is-exit {
  opacity: 0;
  transform: translateY(-120px) scale(0.42);
}

.toast-badge {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(124, 247, 177, 0.22), rgba(18, 183, 106, 0.34));
  box-shadow: inset 0 0 0 1px rgba(124, 247, 177, 0.18);
  flex: 0 0 auto;
  margin-left: 2px;
}

.toast-badge svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #dfffee;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast-copy {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  transform: translateX(-10px);
  transition: max-width 420ms cubic-bezier(.2,.9,.2,1), opacity 220ms ease, transform 420ms cubic-bezier(.2,.9,.2,1);
}

.toast.is-expanded .toast-copy {
  max-width: 380px;
  opacity: 1;
  transform: translateX(0);
}

.toast-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #f4fff9;
  margin: 0 0 2px;
}

.toast-text {
  margin: 0;
  font-size: 13px;
  color: rgba(238, 242, 255, 0.74);
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-glow {
  position: absolute;
  inset: -40px;
  background:
    radial-gradient(circle at 50% 50%, rgba(50, 213, 131, 0.22), transparent 40%),
    linear-gradient(90deg, rgba(50, 213, 131, 0.12), transparent 45%, rgba(50, 213, 131, 0.12));
  filter: blur(12px);
  pointer-events: none;
  opacity: 0.9;
}

.toast::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), transparent 40%);
  pointer-events: none;
}

.toast-mini-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 220ms ease;
}

.toast.is-expanded .toast-mini-label,
.toast.is-collapsing .toast-mini-label {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast-copy,
  button {
    transition: none !important;
  }
}