/**
 * CleoDocs — shared buttons (workspace listings, forms, dashboard, admin).
 * Primary / ghost use --accent from :root; admin overrides on .admin-body (indigo).
 */

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.25rem;
}

/* Primary — solid brand, confident padding, soft lift */
.btn-primary {
    padding: 0.625rem 1.125rem;
    border: none;
    border-radius: 10px;
    background: var(--accent, #6366f1);
    color: #fff;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 2px 8px rgba(15, 23, 42, 0.1);
    transition:
        background-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.12s ease;
}

.btn-primary:hover {
    background: var(--accent-hover, #4f46e5);
    color: #fff;
    box-shadow:
        0 2px 4px rgba(15, 23, 42, 0.08),
        0 6px 20px rgba(15, 23, 42, 0.12);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.btn-primary:focus {
    outline: none;
}

.btn-primary:focus-visible {
    outline: 2px solid var(--accent, #6366f1);
    outline-offset: 2px;
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Secondary — crisp outline, cool gray ink */
.btn-secondary {
    display: inline-block;
    padding: 0.625rem 1.125rem;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.btn-secondary:focus {
    outline: none;
}

.btn-secondary:focus-visible {
    outline: 2px solid var(--accent, #6366f1);
    outline-offset: 2px;
}

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

/* High-caution / destructive-leaning actions — still secondary, never primary */
.btn-secondary.btn-secondary--danger {
    border-color: #fca5a5;
    color: #dc2626;
    background: #fff;
}

.btn-secondary.btn-secondary--danger:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #b91c1c;
}

.btn-small {
    padding: 0.4rem 0.7rem;
    font-size: 0.8125rem;
    border-radius: 8px;
}

/* Optional left icon (inline SVG) — same height as text-only; icon+label, not icon-only */
.btn-icon-left {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    vertical-align: middle;
    line-height: 1.2;
}

.btn-icon-left__icon {
    display: block;
    flex-shrink: 0;
    width: 0.875rem;
    height: 0.875rem;
    color: currentColor;
    opacity: 0.7;
    pointer-events: none;
}

/* Icon without visible label — use with .visually-hidden text or aria-label */
.btn-icon-only.btn-icon-left {
    gap: 0;
    justify-content: center;
    box-sizing: border-box;
    min-width: 1.75rem;
    min-height: 1.75rem;
    padding: 0.25rem;
}

.btn-icon-only .btn-icon-left__icon {
    width: 0.9rem;
    height: 0.9rem;
    opacity: 0.85;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

/* Ghost — minimal chrome; stronger hover for scannability */
.btn-ghost {
    display: inline-block;
    padding: 0.625rem 1.125rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    color: #334155;
    text-decoration: none;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.btn-ghost:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.btn-ghost:focus {
    outline: none;
}

.btn-ghost:focus-visible {
    outline: 2px solid var(--accent, #6366f1);
    outline-offset: 2px;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--color-link, #2563eb);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    transition: color 0.12s ease;
}

.link-button:hover {
    color: var(--accent-hover, #4f46e5);
}

.link-button.danger {
    color: var(--color-danger, #dc2626);
}

.link-button.danger:hover {
    color: #991b1b;
}

.muted {
    color: var(--color-muted, #555);
}

.small {
    font-size: 0.8rem;
}
