/* =========================================================
   BUTTONS
========================================================= */

.btn {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    transition: all var(--transition);
}

.btn svg {
    width: 15px;
    height: 15px;
}

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

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--surface-soft);
}

.btn-ghost {
    background: transparent;
    color: var(--text-2);
}

.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn-success {
    background: var(--success-soft);
    color: var(--success);
}

/* A button whose data is on its way: stays readable, can't be pressed twice. */
.btn.is-loading {
    pointer-events: none;
    opacity: .75;
}

.btn.is-loading::before {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin .7s linear infinite;
}

@keyframes btn-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .btn.is-loading::before { animation-duration: 2s; }
}
