@import url('design-system.css');

/* ================================================================
   Povion — Page Styles (header, hero, events, cards, timeline)
   ================================================================ */

/* ── HEADER ──────────────────────────────────────────────────── */
.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);
}
/* fallback если картинка не загрузится */
.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--ghost {
  padding: 6px 18px;
  background: transparent;
  color: rgba(255,255,255,.85);
  font-size: 14px;
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: var(--radius-md);
}
.header__auth-btn--ghost:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.4);
  color: #fff;
}

.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);
}

.hader__list, .header__list-item { display: none; }

/* ── HERO ─────────────────────────────────────────────────────── */
.test {
  background: var(--navy);
  padding: var(--space-10) 0;
  position: relative;
  overflow: hidden;
}
/* «стартовые блоки» на фоне */
.test::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(47,111,237,.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(242,177,61,.08) 0%, transparent 50%),
    repeating-linear-gradient(90deg, transparent, transparent 58px, rgba(255,255,255,.02) 58px, rgba(255,255,255,.02) 60px);
  pointer-events: none;
}

.test__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-6);
  max-width: 800px;
  margin-inline: auto;
  padding-inline: var(--space-4);
  position: relative; z-index: 1;
}
@media (min-width: 768px) {
  .test__content {
    flex-direction: row;
    text-align: left;
    justify-content: space-between;
  }
}

.test__text { flex: 1; }
.test__title {
  color: #fff;
  margin-bottom: var(--space-3);
}
.test__title em {
  font-style: normal;
  color: var(--gold);
}
.test__desc {
  color: rgba(255,255,255,.7);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: var(--space-5);
}

.test__link {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-weight: 700; font-size: 15px;
  padding: 14px 36px;
  background: var(--gold);
  color: var(--ink);
  border-radius: var(--radius-md);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  text-decoration: none;
}
.test__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(242,177,61,.35);
}

.test__stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-4);
}
@media (min-width: 600px) {
  .test__stats { padding: var(--space-6) var(--space-5); }
}

.test__container img { display: none; }

/* ── EVENTS SECTION ──────────────────────────────────────────── */
.events {
  padding: var(--space-8) 0 var(--space-12);
}
.events__container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (min-width: 768px) {
  .events__container { padding-inline: var(--space-8); }
}

.events__title {
  font-size: 26px; font-weight: 700; margin-bottom: var(--space-5);
  display: flex; align-items: center; gap: var(--space-3);
}
.events__title::before {
  content: '';
  display: inline-block;
  width: 4px; height: 28px;
  background: var(--brand);
  border-radius: var(--radius-full);
}

/* ── TOOLBAR (search + filters) ──────────────────────────────── */
.events__controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  background: var(--bg);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
}

.events__input {
  flex: 1 1 220px;
  padding: 10px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.events__input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,111,237,.12);
  outline: none;
}

.events__select {
  flex: 0 0 auto;
  min-width: 160px;
  padding: 10px 36px 10px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2346536b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.events__select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,111,237,.12);
  outline: none;
}

.events__counter {
  font-size: 13px; color: var(--ink-3);
  padding: 10px 0;
  font-weight: 500;
}
.events__counter strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.events__reset-btn {
  font-size: 13px; color: var(--brand);
  padding: 10px 14px;
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-md);
  background: var(--brand-3);
  font-weight: 600;
  transition: background var(--dur) var(--ease);
}
.events__reset-btn:hover { background: #d4e4ff; }

/* ── 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), transform 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__meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--space-2); margin-top: var(--space-2);
}

.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;
}

/* Expanded details */
.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 {
   font-size: 14px; line-height: 1.55; color: var(--muted);
   margin-top: var(--space-4);
   word-break: break-word;
 }

.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);
}

/* ── 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 FAV BUTTON ──────────────────────────────────────── */
.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 (replaces inline styles) ─────────────────── */
.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);
}

/* ── EVENT LINK ──────────────────────────────────────────────── */
.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); }

/* ── SHOW MORE BUTTON ────────────────────────────────────────── */
.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); }

/* ── SUGGEST LINK ────────────────────────────────────────────── */
.suggest-date-link {
  display: inline-block;
  font-size: 12px;
  color: var(--brand);
  text-decoration: none;
  margin-top: 6px;
  font-weight: 500;
  padding: 2px 0;
  border-bottom: 1px dashed transparent;
  transition: border-color var(--dur) var(--ease);
}
.suggest-date-link:hover {
  border-bottom-color: var(--brand);
}

/* ── SUGGEST MODAL (inline-styled alternative) ───────────────── */
.suggest-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;
}
.suggest-modal.active { display: flex; }
.suggest-modal__card {
  background: var(--surface);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  width: 90%; max-width: 440px;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: modalFade .25s var(--ease);
}
.suggest-modal__close {
  position: absolute; top: 14px; right: 14px;
  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);
}
.suggest-modal__close:hover { background: var(--surface-hover); color: var(--ink); }
.suggest-modal__title {
  font-size: 18px; font-weight: 700;
  text-align: center; margin-bottom: 4px;
}
.suggest-modal__subtitle {
  text-align: center; color: var(--ink-3);
  font-size: 13px; margin-bottom: var(--space-5);
}
.suggest-modal__subtitle b { color: var(--brand); }
.suggest-modal__fields { display: flex; flex-direction: column; gap: var(--space-3); }
.suggest-modal__label {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.suggest-modal__input {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.suggest-modal__input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,111,237,.12);
  outline: none;
}
.suggest-stages-container { display: flex; flex-direction: column; gap: var(--space-3); }

/* ── MODAL (shared for password reset etc.) ──────────────────── */
.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); }

.auth-form__hint {
  margin-top: var(--space-4);
  text-align: center; font-size: 13px;
}
#password-message { margin-top: var(--space-4); text-align: center; font-size: 13px; }
#password-message.success { color: var(--ok); }
#password-message.error   { color: var(--urgent); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  :root { --header-h: 56px; }

  .header__nav img { width: 110px; }

  .event-card__header { flex-wrap: wrap; gap: var(--space-2); }
  .event-card__actions { width: 100%; justify-content: flex-end; }

  .events__controls {
    position: static;
    flex-direction: column;
  }
  .events__input { flex: 1 1 auto; }
  .events__select { flex: 1 1 auto; min-width: 0; }

  .test__stats { grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
  .stat { padding: var(--space-3) var(--space-2); }
  .stat__value { font-size: 22px; }
  .stat__label { font-size: 10px; }
}
