/* Shared UI
 * Split from application.css to keep page-specific styles maintainable.
 */

.toast {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 1000;

    transform: translateX(-50%);

    border-radius: 9999px;
    background: #0f172a;
    color: white;

    padding: 10px 16px;

    font-size: 14px;
    font-weight: 700;

    box-shadow: 0 12px 30px rgba(15,23,42,0.18);

    transition:
            opacity 300ms ease,
            transform 300ms ease;
}

.toast-hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 16px;
    text-decoration: none;
    color: inherit;
}

/* Large enough that the mark reads as three people and a smile, not a dot pattern. */
.app-brand-icon {
    width: 40px;
    height: 40px;
}

.app-brand-text {
    font-size: 22px;
    line-height: 1;
    font-weight: 850;
    letter-spacing: -0.04em;
    color: #0f172a;
}
.legal-page {
    margin: 0 auto;
    max-width: 680px;
    padding: 8px 0 24px;
}

.legal-page h1 {
    margin: 0 0 18px;
    color: #0f172a;
    font-size: 32px;
    line-height: 1.1;
    font-weight: 800;
}

.legal-page h2 {
    margin: 28px 0 10px;
    color: #0f172a;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 800;
}

.legal-page p {
    margin: 0 0 14px;
    color: #475569;
    font-size: 16px;
    line-height: 1.6;
}

.legal-page a {
    color: var(--blue-600);
    font-weight: 700;
}

.app-footer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 18px;

    margin-top: 36px;
    padding: 24px 0 8px;

    color: #94a3b8;
    font-size: 13px;
}

.app-footer-name-origin {
    flex-basis: 100%;
    margin: 0;
    color: #64748b;
    line-height: 1.6;
    text-align: center;
}

.app-footer a {
    color: inherit;
    text-decoration: none;
}

.app-footer a:hover {
    color: #475569;
}

.cookie-banner {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 60;

    max-width: 760px;
    margin: 0 auto;
    padding: 14px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    border: 1px solid var(--blue-100);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

.cookie-banner-text {
    color: #475569;
    font-size: 14px;
    line-height: 1.45;
}

.cookie-banner-text a {
    color: var(--blue-600);
    font-weight: 800;
    text-decoration: none;
}

.cookie-banner-button {
    min-height: 42px;
    border: 0;
    border-radius: 9999px;
    padding: 0 18px;

    flex: 0 0 auto;

    background: var(--blue-600);
    color: #ffffff;

    font-size: 14px;
    font-weight: 800;

    cursor: pointer;
}
    .cookie-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .cookie-banner-button {
        width: 100%;
    }

/* One shared appearance for every item in the application header. */
.user-nav .user-nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px;
    border: 0;
    border-radius: 12px;
    background: #f1f5f9;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.user-nav .user-nav-item:hover {
    background: #e2e8f0;
}

.user-nav .user-nav-item:active {
    background: #cbd5e1;
}

.user-nav .user-nav-item:focus-visible {
    outline: 2px solid var(--blue-600);
    outline-offset: 2px;
}

.user-nav-links > form {
    margin: 0;
}

/* Keep the existing horizontal navigation on tablet and desktop. */
.user-nav-toggle {
    display: none;
}

@media (max-width: 767px) {
    .app-brand {
        flex-shrink: 0;
    }

    .user-nav {
        position: relative;
        flex-shrink: 0;
    }

    .user-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #fff;
        color: #334155;
        cursor: pointer;
    }

    .user-nav .user-nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        z-index: 50;
        width: min(240px, calc(100vw - 28px));
        padding: 8px;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    }

    .user-nav.is-open .user-nav-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .user-nav .user-nav-item {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
    }

    .user-nav-toggle:focus-visible {
        outline: 2px solid var(--blue-600);
        outline-offset: 2px;
    }
}

/* Native single-choice control. Keep options and keyboard behavior in the browser. */
select.form-select {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    min-height: 44px;
    max-width: 100%;
    padding: 10px 42px 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 20px;
    color: #0f172a;
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    cursor: pointer;
}

select.form-select:hover:not(:disabled) {
    border-color: #94a3b8;
    background-color: #f8fafc;
}

select.form-select:focus {
    border-color: var(--blue-500);
    outline: 3px solid var(--blue-200);
    outline-offset: 2px;
}

select.form-select:disabled {
    border-color: #e2e8f0;
    background-color: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
    opacity: 1;
}

/* System colors and arrow remain legible in Windows high contrast mode. */
@media (forced-colors: active) {
    select.form-select {
        -webkit-appearance: auto;
        appearance: auto;
        background-image: none;
    }
}

/* Календарь «Анди» (date_picker_controller) */
.date-picker {
    position: relative;
}

.date-picker-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: #0f172a;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
}

.date-picker-toggle::after {
    content: "";
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}

.date-picker-toggle.is-empty {
    color: #94a3b8;
}

.date-picker-toggle:focus-visible,
.date-picker-toggle[aria-expanded="true"] {
    border-color: var(--blue-600);
    outline: none;
    box-shadow: 0 0 0 3px rgba(9, 110, 250, 0.15);
}

.date-picker-panel {
    position: absolute;
    z-index: 40;
    top: 100%;
    left: 0;
    margin-top: 6px;
    padding: 14px;
    width: 320px;
    max-width: calc(100vw - 32px);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: white;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.date-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.date-picker-title {
    color: #0f172a;
    font-size: 15px;
    font-weight: 700;
}

.date-picker-nav {
    width: 34px;
    height: 34px;
    border-radius: 9999px;
    color: #475569;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.date-picker-nav:hover,
.date-picker-nav:focus-visible {
    background: #f1f5f9;
    outline: none;
}

.date-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.date-picker-weekday {
    padding: 4px 0 6px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.date-picker-weekday:nth-child(n + 6):nth-child(-n + 7) {
    color: #f87171;
}

.date-picker-day {
    aspect-ratio: 1;
    border-radius: 10px;
    color: #0f172a;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.date-picker-day:hover,
.date-picker-day:focus-visible {
    background: var(--blue-50);
    color: var(--blue-700);
    outline: none;
}

.date-picker-day.is-today {
    box-shadow: inset 0 0 0 1.5px var(--blue-300);
    font-weight: 700;
}

.date-picker-day.is-selected {
    background: var(--blue-600);
    color: white;
    font-weight: 700;
}

.date-picker-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.date-picker-action {
    padding: 6px 10px;
    border-radius: 10px;
    color: var(--blue-600);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.date-picker-action:hover,
.date-picker-action:focus-visible {
    background: var(--blue-50);
    outline: none;
}

/* PRO-функции для бесплатных мероприятий */
.pro-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 9999px;
    background: var(--pro-gradient);
    color: white;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

.pro-teaser {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pro-feature-button {
    display: inline-flex;
    margin-top: 10px;
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--blue-600);
    color: white;
    font-weight: 600;
}

.pro-teaser-link {
    color: var(--blue-600);
    font-weight: 600;
}

.event-photo-upload-locked p {
    color: #475569;
    font-size: 14px;
    line-height: 1.45;
}

/* Баннер пробного PRO в профиле */
.trial-offer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px;
    border-radius: 20px;
    background: var(--brand-gradient);
    color: white;
}

.trial-offer-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.trial-offer-text {
    margin-top: 6px;
    color: #e0e7ff;
    font-size: 14px;
    line-height: 1.5;
}

.trial-offer-code {
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.18);
    color: white;
    font-family: ui-monospace, monospace;
    letter-spacing: 0.05em;
}

.trial-offer-button {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 12px 18px;
    border-radius: 12px;
    background: white;
    color: #4c1d95;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 640px) {
    .trial-offer {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Страница ссылки-промокода */
.promo-link-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.promo-link-hero {
    padding: 28px 24px;
    border-radius: 24px;
    background: var(--brand-gradient);
    color: white;
}

.promo-link-hero h1 {
    margin-top: 10px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}

.promo-link-hero p {
    margin-top: 10px;
    color: #e0e7ff;
}

.promo-link-card {
    padding: 22px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: white;
}

.promo-link-card h1,
.promo-link-card h2 {
    font-size: 20px;
    font-weight: 700;
}

.promo-link-card > p {
    margin-top: 8px;
    color: #334155;
}

.promo-link-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    color: #334155;
}

.promo-link-features li {
    display: flex;
    gap: 10px;
}

.promo-link-action {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    color: #334155;
}

.promo-link-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.promo-link-secondary {
    display: inline-flex;
    margin-top: 10px;
    padding: 10px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: #0f172a;
    font-weight: 600;
}

.promo-link-note {
    margin-top: 10px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

/* Поддержка */
.support-page { display: flex; flex-direction: column; gap: 16px; }
.support-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9999px; background: #ef4444; color: white; font-size: 11px; font-weight: 800; line-height: 1; }
.support-messages { display: flex; flex-direction: column; gap: 12px; }
.support-message { max-width: min(560px, 88%); padding: 12px 14px; border-radius: 18px; background: white; border: 1px solid #e2e8f0; }
.support-message-own { align-self: flex-end; border-color: var(--blue-200); background: var(--blue-50); border-bottom-right-radius: 6px; }
.support-message-other { align-self: flex-start; border-bottom-left-radius: 6px; }
.support-message-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; color: #64748b; font-size: 12px; font-weight: 600; }
.support-message-body { margin-top: 4px; color: #0f172a; line-height: 1.5; overflow-wrap: anywhere; }
.support-message-body p + p { margin-top: 6px; }
.support-message-event { margin-top: 6px; color: #475569; font-size: 13px; }
.support-message-event a { color: var(--blue-600); font-weight: 600; }
.support-message-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.support-message-images img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid #e2e8f0; }
.support-status { color: #15803d; font-size: 14px; text-align: center; }
.support-empty { padding: 24px; border: 1px dashed #cbd5e1; border-radius: 18px; background: white; color: #475569; text-align: center; }
.support-empty div { font-size: 32px; }
.support-composer { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid #e2e8f0; border-radius: 18px; background: white; }
.support-label { color: #334155; font-size: 14px; font-weight: 700; }
.support-composer textarea { width: 100%; padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 12px; font-size: 16px; resize: vertical; }
.support-composer-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.support-select { min-width: 0; flex: 0 1 320px; }
.support-file { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 12px; color: #334155; font-weight: 600; cursor: pointer; }
.support-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.support-hint { color: #94a3b8; font-size: 12px; }
.support-submit { align-self: flex-start; padding: 12px 22px; border-radius: 12px; background: var(--blue-600); color: white; font-weight: 700; cursor: pointer; }
.support-errors { padding: 10px 12px; border-radius: 12px; background: #fef2f2; color: #b91c1c; font-size: 14px; }
.support-chat-unread td { background: var(--blue-50); }
.support-admin-panel { display: flex; flex-direction: column; gap: 16px; }
.event-support-link { margin: 24px 0 8px; text-align: center; font-size: 14px; }
.event-support-link a { color: #64748b; text-decoration: underline; }

/* Profile: avatar (UserAvatar) — current picture, built-in library, own upload (PRO). */
.profile-avatar-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar-current {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 9999px;
  font-size: 20px;
  font-weight: 700;
}

.profile-avatar-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 10px;
  /* Eight in a row on wide screens: the 24 pictures make three even rows. */
  max-width: 540px;
}

.profile-avatar-option {
  display: flex;
  justify-content: center;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 9999px;
  background: none;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.profile-avatar-option img {
  width: 100%;
  max-width: 56px;
  height: auto;
}

.profile-avatar-option:hover {
  transform: scale(1.08);
}

.profile-avatar-option:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
}

.profile-avatar-option[aria-pressed="true"] {
  border-color: var(--blue-600);
}

.profile-avatar-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 640px;
}

.profile-avatar-upload-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.profile-avatar-upload-form label {
  flex-basis: 100%;
}

.profile-avatar-file {
  min-width: 0;
  max-width: 100%;
  color: #64748b;
  font-size: 14px;
}

.profile-avatar-file::file-selector-button {
  margin-right: 10px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
}

.profile-avatar-remove {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Landing/SEO feature card: a stack of library avatars instead of the emoji. */
.seo-feature-pictures {
  display: flex;
  height: 40px;
}

.seo-feature-pictures img {
  width: 40px;
  height: 40px;
  border: 2px solid #fff;
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.seo-feature-pictures img + img {
  margin-left: -8px;
}
