@import url('design-system.css');

/* ================================================================
   Povion — Profile (account, favorites, actions)
   ================================================================ */

.header {
  background: var(--navy);
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent, transparent 48px, rgba(255,255,255,.025) 48px, rgba(255,255,255,.025) 50px);
  pointer-events: none;
}
.header__container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
  height: 100%;
}
@media (min-width: 768px) {
  .header__container { padding-inline: var(--space-8); }
}
.header__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-4);
}
.header__nav img {
  width: 140px; height: auto;
  pointer-events: none; flex-shrink: 0;
}
.header__brand { display: flex; align-items: center; gap: var(--space-3); }
.header__brand-text {
  font-weight: 800; font-size: 20px; color: #fff;
  letter-spacing: -.02em;
}
.header__brand-text span { color: var(--gold); }
.header__auth-btn-wrapper { display: flex; align-items: center; gap: var(--space-3); }
.header__auth-btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: all var(--dur) var(--ease);
  font-weight: 600; min-height: 36px;
}
.header__auth-btn--guest {
  padding: 6px 18px;
  background: var(--brand);
  color: #fff; font-size: 14px;
  border-radius: var(--radius-md);
}
.header__auth-btn--guest:hover { background: var(--brand-2); }
.header__auth-btn--user {
  width: 38px; height: 38px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700; font-size: 15px;
  border-radius: 50%;
}
.header__auth-btn--user:hover {
  background: #e5a030;
  box-shadow: 0 0 0 3px rgba(242,177,61,.25);
}

/* ── PROFILE SECTION ─────────────────────────────────────────── */
.profile {
  padding: var(--space-8) 0 var(--space-12);
}
.profile__container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (min-width: 768px) {
  .profile__container { padding-inline: var(--space-8); }
}

.profile__header { margin-bottom: var(--space-6); }
.profile__title {
  font-size: 28px; font-weight: 800;
  color: var(--ink); margin-bottom: 4px;
}
.profile__email { color: var(--ink-3); font-size: 14px; }

/* ── ACTION BUTTONS ──────────────────────────────────────────── */
.profile__actions {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.profile__btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  border: none;
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 40px;
}
.profile__btn:active { transform: scale(.97); }

.profile__btn--back {
  background: var(--surface-hover);
  color: var(--ink-2);
  border: 1.5px solid var(--line-strong);
}
.profile__btn--back:hover { background: var(--line); }

.profile__btn--primary {
  background: var(--brand);
  color: #fff;
}
.profile__btn--primary:hover {
  background: var(--brand-2);
  box-shadow: 0 4px 12px rgba(47,111,237,.3);
}

.profile__btn--danger {
  background: var(--urgent);
  color: #fff;
}
.profile__btn--danger:hover {
  background: #c1373c;
  box-shadow: 0 4px 12px rgba(229,72,77,.3);
}

.profile__btn--dark {
  background: var(--navy);
  color: #fff;
}
.profile__btn--dark:hover { background: var(--navy-2); }

/* ── FAVORITES SUBTITLE ──────────────────────────────────────── */
.profile__subtitle {
  font-size: 22px; font-weight: 700;
  color: var(--ink); margin-bottom: 4px;
  display: flex; align-items: center; gap: var(--space-2);
}
.profile__subtitle::before {
  content: '';
  display: inline-block;
  width: 4px; height: 24px;
  background: var(--brand);
  border-radius: var(--radius-full);
}

.profile__counter {
  color: var(--ink-3); font-size: 13px;
  margin-bottom: var(--space-5);
  font-weight: 500;
}

/* ── EVENTS LIST ─────────────────────────────────────────────── */
.events__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ── EVENT CARD ──────────────────────────────────────────────── */
.event-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease);
  border-left: 4px solid var(--line-strong);
}
.event-card:hover { box-shadow: var(--shadow-md); }
.event-card.open { box-shadow: var(--shadow-lg); border-color: var(--brand); }

.event-card__header {
  display: flex; align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  cursor: default;
}
.event-card__title-wrapper { flex: 1; min-width: 0; }
.event-card__title {
  font-size: 17px; font-weight: 700; line-height: 1.35;
  color: var(--ink); margin: 0; word-break: break-word;
}
.event-card__actions {
  display: flex; align-items: center; gap: var(--space-2);
  flex-shrink: 0;
}
.event-card__fav-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  font-size: 18px;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
  color: var(--ink-3);
}
.event-card__fav-btn:hover { background: var(--surface-hover); transform: scale(1.1); }
.event-card__fav-btn.active { color: var(--urgent); }
.event-card__toggle-btn {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 6px 14px;
  background: var(--brand-3); color: var(--brand);
  border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.event-card__toggle-btn:hover { background: var(--brand); color: #fff; }

.event-card__details {
  max-height: 0; overflow: hidden;
  transition: max-height .4s var(--ease), padding .4s var(--ease);
  padding: 0 var(--space-5);
}
.event-card.open .event-card__details {
  max-height: none;
  padding: 0 var(--space-5) var(--space-5);
  border-top: 1px solid var(--line);
}

.event-card__general-desc {
  color: var(--ink-2); font-size: 14px; line-height: 1.6;
  margin-bottom: var(--space-5);
}
.event-card__profiles-title {
  font-size: 15px; font-weight: 600; color: var(--ink);
  margin: 0 0 var(--space-3);
}
.event-card__profiles {
  display: flex; flex-direction: column; gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.event-card__link {
  display: inline-flex; align-items: center; gap: var(--space-1);
  margin-top: var(--space-2);
  color: var(--brand); text-decoration: none;
  font-weight: 600; font-size: 14px;
  transition: color var(--dur) var(--ease);
}
.event-card__link:hover { color: var(--brand-2); }
.event-card__show-more {
  width: 100%; padding: 10px;
  background: var(--surface-2);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-weight: 600; font-size: 13px; color: var(--ink-2);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.event-card__show-more:hover {
  background: var(--surface-hover);
  border-color: var(--brand); color: var(--brand);
}
.event-card__profiles--favorite { margin-bottom: var(--space-3); }

/* ── PROFILE ITEM ────────────────────────────────────────────── */
.profile-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease);
}
.profile-item:hover { box-shadow: var(--shadow-sm); }
.profile-item__header {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px 14px; cursor: pointer;
  user-select: none;
  font-weight: 600; font-size: 14px; color: var(--ink);
  background: transparent;
  transition: background var(--dur) var(--ease);
}
.profile-item__header:hover { background: rgba(0,0,0,.02); }
.profile-item__title-wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
  flex: 1; min-width: 0;
}
.profile-item__name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-item__toggle {
  background: transparent; border: none;
  font-size: 12px; color: var(--brand);
  cursor: pointer; padding: 4px 6px;
  transition: transform var(--dur) var(--ease);
}
.profile-item.open .profile-item__toggle { transform: rotate(180deg); }
.profile-item__content {
  max-height: 0; overflow: hidden;
  padding: 0 14px;
  transition: max-height .3s var(--ease), padding .3s var(--ease);
  background: var(--surface);
}
.profile-item.open .profile-item__content { max-height: none; padding: 12px 14px 14px; }
.profile-item__content p {
  margin: 4px 0; font-size: 13px; color: var(--ink-2); line-height: 1.5;
}
.profile-item__content p strong { color: var(--ink); }
.profile-item__note { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.profile-item__fav {
  margin-top: 8px; padding: 7px 16px;
  background: transparent; color: var(--brand);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-full);
  cursor: pointer; font-weight: 600; font-size: 13px;
  transition: all var(--dur) var(--ease);
}
.profile-item__fav:hover { background: var(--brand); color: #fff; }
.profile-item__fav.active { background: var(--brand); color: #fff; }

/* ── LEVEL BADGES ────────────────────────────────────────────── */
.profile-item__level {
  font-size: 11px; padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700; white-space: nowrap;
}
.profile-item__level--first { background: var(--gold-3); color: #b8860b; border: 1px solid #f0d78c; }
.profile-item__level--second { background: var(--neutral-3); color: #1d4ed8; border: 1px solid #a5c4ff; }
.profile-item__level--third { background: var(--ok-3); color: #065f46; border: 1px solid #86efac; }

/* ── STATUS BADGES ───────────────────────────────────────────── */
.profile-item__badge {
  font-size: 11px; padding: 2px 9px;
  border-radius: var(--radius-full);
  font-weight: 700; white-space: nowrap;
}
.badge--active, .profile-item__badge--active { background: var(--ok-3); color: var(--ok); }
.badge--urgent, .profile-item__badge--urgent { background: var(--urgent-3); color: var(--urgent); animation: pulse 1.5s infinite; }
.badge--neutral, .profile-item__badge--neutral { background: var(--neutral-3); color: var(--neutral); }
.badge--finished, .profile-item__badge--finished { background: var(--muted-3); color: var(--muted); }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

/* ── FAVORITE PROFILE ────────────────────────────────────────── */
.profile-item--favorite { border-left: 3px solid var(--gold); background: var(--gold-3); }

/* ── STAGE TIMELINE ──────────────────────────────────────────── */
.stage-rail {
  position: relative;
  padding-left: 20px;
  margin: 8px 0 12px;
  font-size: 13px;
  line-height: 1.7;
}
.stage-rail::before {
  content: '';
  position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--line-strong);
  border-radius: var(--radius-full);
}
.stage-rail__item {
  position: relative;
  padding: 0 0 6px 8px;
}
.stage-rail__item:last-child { padding-bottom: 0; }
.stage-rail__item::before {
  content: '';
  position: absolute;
  left: -17px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--surface);
}
.stage-rail__item.stage-rail__item--done::before { background: var(--ok); border-color: var(--ok); }
.stage-rail__item.stage-rail__item--current::before {
  background: var(--brand); border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(47,111,237,.2);
}
.stage-rail__item.stage-rail__item--next::before {
  background: var(--surface); border-color: var(--brand);
  border-style: dashed;
}
.stage-rail__name { font-weight: 600; color: var(--ink); }
.stage-rail__date { color: var(--ink-3); font-family: var(--mono); }
.stage-rail__item.stage-rail__item--current .stage-rail__name { font-weight: 700; color: var(--brand); }
.stage-rail__item.stage-rail__item--done .stage-rail__name { color: var(--ink-3); }

/* ── MODAL (password change) ─────────────────────────────────── */
.modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  z-index: 1000;
}
.modal.active { display: flex; }
.modal__overlay { position: absolute; inset: 0; }
.modal__content {
  position: relative;
  background: var(--surface);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  max-width: 400px; width: 90%;
  z-index: 1001;
  box-shadow: var(--shadow-xl);
  animation: modalFade .25s var(--ease);
}
@keyframes modalFade {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal__close {
  position: absolute; top: 12px; right: 12px;
  background: var(--surface-hover); border: none;
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  font-size: 18px; color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.modal__close:hover { background: var(--surface-hover); color: var(--ink); }
.modal__title { text-align: center; color: var(--ink); margin-bottom: var(--space-2); font-size: 18px; }
.modal__text { font-size: 14px; color: var(--ink-2); text-align: center; margin-bottom: var(--space-5); line-height: 1.5; }
.auth-form__submit {
  width: 100%; padding: 12px;
  background: var(--brand); color: #fff;
  border: none; border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.auth-form__submit:hover { background: var(--brand-2); }

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: var(--space-12) var(--space-4);
  text-align: center; color: var(--ink-3);
}
.empty-state__icon { font-size: 48px; margin-bottom: var(--space-4); opacity: .5; }
.empty-state__text { font-size: 16px; margin-bottom: var(--space-4); color: var(--ink-2); font-weight: 500; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  :root { --header-h: 56px; }
  .header__nav img { width: 110px; }
  .profile__actions { flex-direction: column; }
  .profile__btn { width: 100%; justify-content: center; }
}