/* ============================================================
   COMPONENTS: кнопки, карточки, формы, alerts, иконки
   ============================================================ */

/* --- Кнопки --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 24px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--t-base);
    text-decoration: none;
    white-space: nowrap;
}

.btn--primary {
    background: var(--brand-red);
    color: #fff;
}

.btn--primary:hover {
    background: var(--brand-red-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(193, 39, 45, 0.3);
}

.btn--ghost {
    background: transparent;
    color: var(--text-main);
    border-color: var(--border-soft);
}

.btn--ghost:hover {
    border-color: var(--brand-red);
    color: var(--brand-red);
}

.btn--danger {
    background: transparent;
    color: var(--brand-red);
    border-color: var(--brand-red);
}

.btn--danger:hover {
    background: var(--brand-red);
    color: #fff;
}

.btn--sm {
    padding: 7px 16px;
    font-size: 13px;
}

/* --- Карточки --- */
.card {
    background: var(--card-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t-base), transform var(--t-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* --- Поля ввода --- */
.field {
    display: block;
    margin-bottom: 18px;
}

.field__label {
    display: block;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.field__input,
.field__textarea,
.field__select {
    display: block;
    width: 100%;
    padding: 11px 14px;
    background: var(--card-white);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.field__input:focus,
.field__textarea:focus,
.field__select:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px var(--brand-red-soft);
}

.field__textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.55;
}

.field__hint {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.field__row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.field__row .field__input {
    flex: 1;
}

/* Чекбокс-переключатель */
.switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch__track {
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: #d8ccb8;
    position: relative;
    transition: background var(--t-base);
}

.switch__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-base);
}

.switch input:checked+.switch__track {
    background: var(--brand-red);
}

.switch input:checked+.switch__track::after {
    transform: translateX(18px);
}

.switch__label {
    font-size: 14px;
    color: var(--text-main);
}

/* --- Alerts --- */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    border-left: 4px solid transparent;
}

.alert--success {
    background: #e8f5ec;
    border-left-color: #4a9a5f;
    color: #2a5f38;
}

.alert--error {
    background: var(--brand-red-soft);
    border-left-color: var(--brand-red);
    color: var(--brand-red-dark);
}

.alert--warning {
    background: #fef5e7;
    border-left-color: #d4a574;
    color: #8a6535;
}

.alert--info {
    background: #e8eef5;
    border-left-color: var(--accent-blue);
    color: #2a4a63;
}

/* --- Иконки --- */
.icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon--lg {
    width: 22px;
    height: 22px;
}

.icon--sm {
    width: 13px;
    height: 13px;
}

/* --- Бейдж-счётчик --- */
.count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-warm);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

/* --- Разделитель --- */
.divider {
    height: 1px;
    background: var(--border-soft);
    border: 0;
    margin: 24px 0;
}