/* ==========================================================================
   Favorite Events — интерфейс оператора: вход, список, создание.
   Редактор — в editor.css.
   ========================================================================== */

:root {
    --bg:          #f6f3ee;
    --bg-deep:     #efeae2;
    --surface:     #ffffff;
    --ink:         #1d1a17;
    --ink-soft:    #4a443d;
    --muted:       #8a8178;
    --line:        #e7e0d5;
    --line-strong: #d6ccbd;
    --accent:      #b07a3b;
    --accent-deep: #8d5f2a;
    --accent-soft: #f6ecdc;
    --violet:      #6d4fd8;
    --violet-soft: #efebfd;
    --danger:      #c0412f;
    --danger-soft: #fcebe7;
    --success:     #2e7d4f;
    --success-soft:#e3f3e9;

    --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --radius: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(29, 26, 23, .06);
    --shadow: 0 1px 2px rgba(29, 26, 23, .05), 0 10px 30px -12px rgba(29, 26, 23, .18);
    --shadow-lg: 0 30px 80px -30px rgba(29, 26, 23, .45);
    --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 var(--font-body);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-deep); }

svg { flex: none; }

[hidden] { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.muted { color: var(--muted); font-weight: 400; }

.hint {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.5;
}

/* --- Логотип --- */

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

.brand__mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--ink);
    color: #f1d9a8;
    font-size: 17px;
}

.brand__name {
    font: 600 21px/1 var(--font-display);
    letter-spacing: .01em;
}

/* --- Кнопки --- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: none;
    color: inherit;
    font: 600 14px/1 var(--font-body);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .18s, border-color .18s, color .18s, box-shadow .18s, transform .18s var(--ease);
}

.button svg,
.icon-button svg,
.link-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.button:active:not(:disabled) { transform: translateY(1px); }

.button:focus-visible,
.icon-button:focus-visible,
.chip:focus-visible,
.link-button:focus-visible {
    outline: 3px solid rgba(176, 122, 59, .35);
    outline-offset: 2px;
}

.button:disabled { opacity: .45; cursor: not-allowed; }

.button--primary {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 6px 16px -8px rgba(29, 26, 23, .7);
}

.button--primary:hover:not(:disabled) { background: #000; }

.button--accent {
    background: var(--accent);
    color: #fff;
}

.button--accent:hover:not(:disabled) { background: var(--accent-deep); }

.button--magic {
    background: linear-gradient(135deg, #7b5cf0, #b45bd6);
    color: #fff;
    box-shadow: 0 8px 20px -10px rgba(109, 79, 216, .9);
}

.button--magic:hover:not(:disabled) { filter: brightness(1.06); }

.button--ghost {
    border-color: var(--line-strong);
    background: var(--surface);
}

.button--ghost:hover:not(:disabled) { border-color: var(--ink); }

.button--danger {
    border-color: #efc9c1;
    background: var(--surface);
    color: var(--danger);
}

.button--danger:hover:not(:disabled) { background: var(--danger-soft); }

.button--lg { min-height: 48px; padding: 0 22px; font-size: 15px; }
.button--sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.button--wide { width: 100%; }

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--ink-soft);
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .18s;
}

.icon-button:hover { background: var(--bg-deep); }

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-soft);
    font: 500 13.5px/1.4 var(--font-body);
    text-decoration: none;
    cursor: pointer;
}

.link-button:hover { color: var(--ink); text-decoration: underline; }
.link-button--danger { color: var(--danger); }

.avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-weight: 700;
    font-size: 14px;
}

/* --- Поля --- */

.form { display: grid; gap: 18px; }

.field { display: grid; gap: 7px; }

.field__label {
    color: var(--ink-soft);
    font-size: 13.5px;
    font-weight: 600;
}

.field__label .muted { margin-left: 6px; font-size: 12.5px; }

.input {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: inherit;
    font: inherit;
    transition: border-color .18s, box-shadow .18s;
}

.input::placeholder { color: #b3aaa0; }

.input:hover { border-color: #c4b8a6; }

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(176, 122, 59, .14);
}

.input--lg { min-height: 54px; font-size: 18px; padding: 12px 18px; }
.input--sm { min-height: 34px; padding: 6px 10px; font-size: 13.5px; border-radius: 9px; }

textarea.input { resize: vertical; line-height: 1.55; }

/* --- Сообщения --- */

.alert {
    margin: 0 0 18px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
}

.alert--error { background: var(--danger-soft); color: var(--danger); }
.alert--success { background: var(--success-soft); color: var(--success); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge--draft { background: #f1ece4; color: #8a7a64; }
.badge--published { background: var(--success-soft); color: var(--success); }
.badge--archived { background: #ededed; color: #8b8b8b; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    font: 600 13.5px/1 var(--font-body);
    cursor: pointer;
    transition: background-color .18s, border-color .18s, color .18s;
}

.chip:hover { border-color: var(--ink); }

.chip.is-active {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.chip__count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(29, 26, 23, .07);
    font-size: 11.5px;
    font-weight: 700;
}

.chip.is-active .chip__count { background: rgba(255, 255, 255, .2); }

.chip__count:empty { display: none; }

/* ==========================================================================
   Вход
   ========================================================================== */

.login {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(800px 500px at 15% 10%, rgba(176, 122, 59, .16), transparent 60%),
        radial-gradient(700px 500px at 90% 90%, rgba(109, 79, 216, .10), transparent 60%),
        var(--bg);
}

.login__card {
    width: 100%;
    max-width: 420px;
    padding: 44px 40px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 255, 255, .85);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.login__title {
    margin: 30px 0 6px;
    font: 500 36px/1.1 var(--font-display);
}

.login__lead {
    margin: 0 0 26px;
    color: var(--muted);
}

/* ==========================================================================
   Каркас
   ========================================================================== */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 32px;
    border-bottom: 1px solid var(--line);
    background: rgba(246, 243, 238, .86);
    backdrop-filter: blur(14px);
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 32px 80px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.page-head__title {
    margin: 0;
    font: 500 44px/1.05 var(--font-display);
    letter-spacing: -.01em;
}

.page-head__lead {
    margin: 8px 0 0;
    color: var(--muted);
}

.back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.back:hover { color: var(--ink); }

/* ==========================================================================
   Список приглашений
   ========================================================================== */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
}

.search {
    position: relative;
    flex: 1 1 280px;
    max-width: 420px;
}

.search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--muted);
    stroke-width: 2;
    stroke-linecap: round;
}

.search__input {
    width: 100%;
    min-height: 42px;
    padding: 0 16px 0 42px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface);
    font: inherit;
}

.search__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(176, 122, 59, .14);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.invs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

.inv {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}

.inv:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.inv__open { display: block; text-decoration: none; }

.inv__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px 18px;
}

.inv__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.inv__responses {
    color: var(--violet);
    font-size: 12.5px;
    font-weight: 700;
}

.inv__title {
    margin: 4px 0 0;
    font: 600 17px/1.3 var(--font-body);
}

.inv__title a { color: inherit; text-decoration: none; }
.inv__title a:hover { text-decoration: underline; }

.inv__meta {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
}

.inv__foot { margin-top: auto; padding-top: 8px; }

.inv__site {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    overflow: hidden;
    color: var(--success);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inv__site svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.inv__site:hover { text-decoration: underline; }

.inv__edited { color: var(--muted); font-size: 12.5px; }

.empty {
    padding: 60px 0;
    color: var(--muted);
    text-align: center;
}

.welcome {
    max-width: 560px;
    margin: 40px auto;
    padding: 56px 40px;
    border: 1px dashed var(--line-strong);
    border-radius: 28px;
    background: rgba(255, 255, 255, .6);
    text-align: center;
}

.welcome__art {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 22px;
    background: var(--ink);
    color: #f1d9a8;
    font-size: 32px;
}

.welcome__title {
    margin: 0 0 10px;
    font: 500 32px/1.15 var(--font-display);
}

.welcome__text {
    margin: 0 0 26px;
    color: var(--ink-soft);
}

/* --- мини-обложка в цветах и шрифтах приглашения --- */

.mini {
    --m-bg: #222;
    --m-text: #fff;
    --m-muted: #aaa;
    --m-accent: #d4af6a;
    --m-accent-light: #f4dfae;
    --m-title: Georgia, serif;
    --m-script: cursive;
    --m-weight: 400;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    aspect-ratio: 4 / 3;
    padding: 18px;
    overflow: hidden;
    background:
        radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--m-accent) 22%, transparent), transparent 70%),
        var(--m-bg);
    color: var(--m-text);
    text-align: center;
    container-type: inline-size;
}

.mini > p { margin: 0; max-width: 100%; }

.mini__frame {
    position: absolute;
    inset: 10px;
    border: 1px solid color-mix(in srgb, var(--m-accent) 45%, transparent);
    border-radius: 8px;
}

.mini__script {
    font: 400 clamp(12px, 6.5cqi, 20px)/1.2 var(--m-script);
    color: var(--m-accent);
}

.mini__title {
    font: var(--m-weight) clamp(16px, 10cqi, 32px)/1.05 var(--m-title);
    overflow-wrap: anywhere;
}

.mini__accent {
    font: var(--m-weight) clamp(30px, 22cqi, 72px)/.95 var(--m-title);
    color: var(--m-accent);
}

.mini__subtitle {
    font: italic 400 clamp(11px, 5.5cqi, 17px)/1.2 var(--m-title);
    color: var(--m-accent);
}

.mini__date {
    margin-top: 6px !important;
    color: var(--m-muted);
    font: 600 clamp(8px, 3.4cqi, 11px)/1.3 var(--font-body);
    letter-spacing: .2em;
    text-transform: uppercase;
}

.mini--lg { aspect-ratio: 5 / 4; }

/* ==========================================================================
   Создание
   ========================================================================== */

.create__head {
    display: grid;
    gap: 22px;
    max-width: 640px;
    margin-bottom: 34px;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -1px;
    padding: 12px 16px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--muted);
    font: 600 15px/1 var(--font-body);
    cursor: pointer;
}

.tabs__tab:hover { color: var(--ink); }

.tabs__tab.is-active {
    border-bottom-color: var(--ink);
    color: var(--ink);
}

.picks .hint { margin-bottom: 18px; }

.picks__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.pick {
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
    cursor: pointer;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s;
}

.pick:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.pick.is-active {
    border-color: var(--ink);
    box-shadow: var(--shadow);
}

.pick__body { padding: 16px 18px 18px; }

.pick__name {
    margin: 0 0 4px;
    font: 600 18px/1.25 var(--font-body);
}

.pick__desc {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13.5px;
}

.pick__palette {
    margin: 8px 0 0;
    color: var(--ink-soft);
    font-size: 12.5px;
    font-weight: 600;
}

.pick__choose {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    cursor: pointer;
}

.dots { display: flex; flex-wrap: wrap; gap: 8px; }

.dot { position: relative; cursor: pointer; }

.dot input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dot__chip {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
    transition: transform .18s var(--ease), box-shadow .18s;
}

.dot:hover .dot__chip { transform: scale(1.1); }

.dot input:checked + .dot__chip {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 0 0 2px var(--surface), 0 0 0 4px var(--ink);
}

.dot input:focus-visible + .dot__chip { outline: 3px solid rgba(176, 122, 59, .4); outline-offset: 4px; }

.empty-box {
    padding: 32px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .6);
}

.empty-box p { margin: 0 0 6px; }

.create__bar {
    position: sticky;
    bottom: 20px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 34px;
    padding: 14px 14px 14px 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
}

.create__summary {
    margin: 0;
    color: var(--ink-soft);
    font-weight: 600;
}

/* ==========================================================================
   Всплывающие окна (общие для страниц)
   ========================================================================== */

.toasts {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 100;
    display: grid;
    gap: 8px;
    transform: translateX(-50%);
    pointer-events: none;
}

.toast {
    padding: 12px 18px;
    border-radius: 12px;
    background: var(--ink);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toast-in .3s var(--ease);
    pointer-events: auto;
}

.toast--error { background: var(--danger); }

.toast button {
    margin-left: 12px;
    padding: 0;
    border: 0;
    background: none;
    color: #f1d9a8;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(29, 26, 23, .45);
    backdrop-filter: blur(3px);
    animation: fade-in .2s;
}

.modal__box {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 30px;
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: pop-in .25s var(--ease);
}

.modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
}

.modal__title {
    margin: 0 0 8px;
    padding-right: 30px;
    font: 500 30px/1.15 var(--font-display);
}

.modal__text {
    margin: 0 0 20px;
    color: var(--ink-soft);
}

.modal__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ==========================================================================
   Узкие экраны
   ========================================================================== */

@media (max-width: 720px) {
    .topbar { padding: 10px 16px; }
    .container { padding: 24px 16px 60px; }
    .page-head { flex-direction: column; align-items: stretch; }
    .page-head__title { font-size: 34px; }
    .login__card { padding: 34px 24px; }
    .create__bar { flex-direction: column; align-items: stretch; }
}
