/* ═══════════════════════════════════════════════════════════
   Buttons — extracted from TNonline (NewBooking / Login / Settings)
   Base + variants (primary, secondary, danger, ghost), sizes,
   and a full-width block modifier. Pair with an icon (e.g.
   Bootstrap Icons <i class="bi bi-...">) for icon buttons.
   ═══════════════════════════════════════════════════════════ */

.tn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* em-based padding + gap so the whole button scales with its font-size */
    gap: 0.5em;
    padding: 0.66em 1.6em;
    /* fluid font-size: grows gently with the viewport, clamped to the tokens */
    font-size: clamp(var(--tn-font-size-sm), 0.74rem + 0.25vw, var(--tn-font-size-base));
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    border-radius: var(--tn-radius);
    cursor: pointer;
    transition: all var(--tn-transition);
    border: 1.5px solid transparent;
    white-space: nowrap;
}

.tn-btn:disabled,
.tn-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tn-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.3);
}

/* ── Primary — solid teal, lifts on hover ── */
.tn-btn--primary {
    background: var(--tn-accent);
    color: #fff;
    border-color: var(--tn-accent);
}

.tn-btn--primary:hover:not(:disabled) {
    background: var(--tn-accent-hover);
    box-shadow: 0 4px 14px rgba(13, 115, 119, 0.3);
    transform: translateY(-1px);
}

.tn-btn--primary:active:not(:disabled) {
    background: var(--tn-accent-active);
    transform: translateY(0);
}

/* ── Secondary — outlined, neutral ── */
.tn-btn--secondary {
    background: var(--tn-bg-card);
    color: var(--tn-text-secondary);
    border: 1.5px solid var(--tn-border);
}

.tn-btn--secondary:hover:not(:disabled) {
    background: var(--tn-bg-hover);
    border-color: var(--tn-text-secondary);
    color: var(--tn-text-primary);
}

/* ── Danger — destructive actions ── */
.tn-btn--danger {
    background: var(--tn-danger);
    color: #fff;
    border-color: var(--tn-danger);
}

.tn-btn--danger:hover:not(:disabled) {
    background: #A52323;
    box-shadow: 0 4px 14px rgba(197, 48, 48, 0.3);
    transform: translateY(-1px);
}

.tn-btn--danger:active:not(:disabled) {
    transform: translateY(0);
}

/* ── Ghost — text-only, no chrome until hover ── */
.tn-btn--ghost {
    background: transparent;
    color: var(--tn-text-secondary);
    border-color: transparent;
}

.tn-btn--ghost:hover:not(:disabled) {
    background: var(--tn-bg-hover);
    color: var(--tn-text-primary);
}

/* ── Sizes ── (only the font-size changes; em padding rescales the rest) */
.tn-btn--sm {
    font-size: var(--tn-font-size-xs);
    padding: 0.5em 1.1em;
}

.tn-btn--lg {
    font-size: clamp(var(--tn-font-size-base), 0.86rem + 0.4vw, var(--tn-font-size-lg));
    font-weight: 700;
}

/* ── Full width ── */
.tn-btn--block {
    width: 100%;
}

/* Icon scales with the button's font-size */
.tn-btn .bi {
    font-size: 1em;
}

/* ═══════════════════════════════════════════════════════════
   Button group — wraps responsively; --stack makes every button
   go full-width on narrow screens (mirrors TNonline action rows).
   ═══════════════════════════════════════════════════════════ */
.tn-btn-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--tn-space-sm);
}

.tn-btn-group--end {
    justify-content: flex-end;
}

@media (max-width: 640px) {
    .tn-btn-group--stack {
        align-items: stretch;
    }

    .tn-btn-group--stack .tn-btn {
        flex: 1 1 100%;
    }
}
