/* ============================================================
   POSTERX · BASE
   Reset, типографика, кнопки, формы, иконки, скроллбар, утилиты.
   ============================================================ */

/* ============================================================
   RESET
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-ui);
    font-size: var(--fs-md);
    line-height: var(--lh-normal);
    font-weight: var(--fw-regular);
    color: var(--text);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition), color var(--transition);
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin: 0;
}

[hidden] {
    display: none !important;
}

::selection {
    background: var(--accent-soft);
    color: var(--text);
}

/* ============================================================
   ТИПОГРАФИКА
   ============================================================ */

h1 {
    font-size: var(--fs-3xl);
    line-height: var(--lh-tight);
    font-weight: var(--fw-extrabold);
    letter-spacing: -0.03em;
}

h2 {
    font-size: var(--fs-xl);
    line-height: var(--lh-tight);
    font-weight: var(--fw-bold);
    letter-spacing: -0.01em;
}

h3 {
    font-size: var(--fs-lg);
    line-height: var(--lh-tight);
    font-weight: var(--fw-bold);
}

h4 {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
}

small {
    font-size: var(--fs-sm);
}

code,
kbd,
samp {
    font-family: var(--font-mono);
    font-size: 0.92em;
    padding: 1px 5px;
    border-radius: var(--radius-xs);
    background: var(--bg-surface-2);
    color: var(--text);
}

mark {
    background: var(--warning-soft);
    color: var(--text);
    padding: 0 2px;
    border-radius: 2px;
}

/* ============================================================
   ИКОНКИ (LUCIDE)
   ============================================================ */

[data-lucide] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 1.8;
    vertical-align: middle;
}

.brand-icon [data-lucide] {
    width: 21px;
    height: 21px;
    stroke-width: 2.3;
}

.nav-icon [data-lucide] {
    width: 19px;
    height: 19px;
}

.icon-button [data-lucide],
.theme-toggle [data-lucide] {
    width: 20px;
    height: 20px;
}

.button [data-lucide] {
    width: 15px;
    height: 15px;
}

.empty-icon [data-lucide] {
    width: 23px;
    height: 23px;
}

.mobile-nav [data-lucide] {
    width: 19px;
    height: 19px;
}

/* ============================================================
   КНОПКИ
   ============================================================ */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);

    min-height: 38px;
    padding: 0 var(--space-4);

    border: 1px solid transparent;
    border-radius: var(--radius-sm);

    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    line-height: 1;
    white-space: nowrap;

    cursor: pointer;
    user-select: none;

    transition: background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.button:active:not(:disabled) {
    transform: translateY(1px);
}

.button:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.button-primary {
    background: var(--accent);
    color: var(--text-on-accent);
    box-shadow: 0 4px 14px var(--accent-glow);
}

.button-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.button-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.button-outline:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.button-secondary {
    background: var(--bg-surface-2);
    border-color: var(--border);
    color: var(--text);
}

.button-secondary:hover:not(:disabled) {
    background: var(--bg-surface-hover);
    border-color: var(--border-hover);
}

.button-danger {
    background: var(--danger);
    color: #ffffff;
}

.button-danger:hover:not(:disabled) {
    filter: brightness(1.08);
}

.button-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.button-ghost:hover:not(:disabled) {
    background: var(--bg-surface-hover);
    color: var(--text);
}

.button-sm {
    min-height: 30px;
    padding: 0 var(--space-3);
    font-size: var(--fs-xs);
    border-radius: var(--radius-xs);
}

.button-block {
    width: 100%;
}

/* Иконочные кнопки */
.icon-button {
    display: inline-grid;
    place-items: center;

    width: 44px;
    height: 44px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--bg-surface);
    color: var(--text);

    transition: background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.icon-button:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-hover);
}

.icon-button:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

/* ============================================================
   ФОРМЫ
   ============================================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    min-height: 40px;

    padding: 9px 12px;

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    background: var(--bg-input);
    color: var(--text);

    font-family: inherit;
    font-size: var(--fs-md);
    line-height: var(--lh-normal);

    outline: none;

    transition: border-color var(--transition-fast),
        background-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--border-hover);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

textarea {
    resize: vertical;
    min-height: 100px;
    line-height: var(--lh-loose);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2371829e' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--accent);
    cursor: pointer;
}

label {
    cursor: pointer;
}

/* ============================================================
   СКРОЛЛБАР
   ============================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
    border: 2px solid var(--bg-page);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* ============================================================
   ФОКУС
   ============================================================ */

:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
    border-radius: inherit;
}

/* ============================================================
   УТИЛИТЫ
   ============================================================ */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.text-accent {
    color: var(--accent);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.tabular-nums {
    font-variant-numeric: tabular-nums;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   АНИМАЦИИ (переиспользуемые)
   ============================================================ */

@keyframes px-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes px-fade-slide {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes px-spin {
    to { transform: rotate(360deg); }
}

@keyframes px-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}