/* Tennant component primitives — used by preview cards + UI kits */
@import url("colors_and_type.css");

/* ===== Buttons ===== */
.tn-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 4px; font-family: var(--font-heading); font-weight: 600; font-size: 14px; letter-spacing: 0.01em; border: 1.5px solid transparent; cursor: pointer; transition: background .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease; user-select: none; }
.tn-btn:focus-visible { outline: 2px solid var(--tn-blue-500); outline-offset: 2px; }

.tn-btn--primary { background: var(--tn-blue-500); color: #fff; }
.tn-btn--primary:hover { background: var(--tn-blue-600); }
.tn-btn--primary:active { background: var(--tn-blue-700); }
.tn-btn--primary[disabled], .tn-btn--primary.is-disabled { background: var(--tn-steel-300); color: var(--tn-steel-500); cursor: not-allowed; }

.tn-btn--secondary { background: #fff; color: var(--tn-blue-600); border-color: var(--tn-blue-500); }
.tn-btn--secondary:hover { background: var(--tn-blue-50); }
.tn-btn--secondary:active { background: var(--tn-blue-100); }
.tn-btn--secondary[disabled] { color: var(--tn-steel-500); border-color: var(--tn-steel-300); cursor: not-allowed; }

.tn-btn--ghost { background: transparent; color: var(--tn-steel-800); }
.tn-btn--ghost:hover { background: var(--tn-steel-100); }
.tn-btn--ghost[disabled] { color: var(--tn-steel-500); cursor: not-allowed; }

.tn-btn--danger { background: var(--tn-error-500); color: #fff; }
.tn-btn--danger:hover { background: #A5251F; }
.tn-btn--danger[disabled] { background: var(--tn-steel-300); color: var(--tn-steel-500); cursor: not-allowed; }

.tn-btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.tn-btn--lg { height: 48px; padding: 0 24px; font-size: 15px; }

/* ===== Inputs ===== */
.tn-field { display: flex; flex-direction: column; gap: 4px; }
.tn-field__label { font-family: var(--font-heading); font-weight: 600; font-size: 12px; letter-spacing: 0.02em; color: var(--fg-1); }
.tn-input { height: 40px; padding: 0 12px; background: #fff; border: 1.5px solid var(--border-1); border-radius: 4px; font: 400 14px/1 var(--font-body); color: var(--fg-1); transition: border-color .12s ease, box-shadow .12s ease; }
.tn-input::placeholder { color: var(--tn-steel-500); }
.tn-input:hover { border-color: var(--tn-steel-500); }
.tn-input:focus { outline: none; border-color: var(--tn-blue-500); box-shadow: 0 0 0 3px rgba(0,147,208,0.18); }
.tn-input.is-error { border-color: var(--tn-error-500); box-shadow: 0 0 0 3px rgba(200,50,44,0.18); }
.tn-input[disabled] { background: var(--tn-steel-100); color: var(--tn-steel-500); cursor: not-allowed; }
.tn-field__help { font-size: 11.5px; color: var(--fg-3); }
.tn-field__help.is-error { color: var(--tn-error-500); }

/* ===== Checkbox + Radio ===== */
.tn-check, .tn-radio { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fg-1); cursor: pointer; }
.tn-check__box, .tn-radio__dot { width: 18px; height: 18px; border: 1.5px solid var(--tn-steel-500); background: #fff; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.tn-check__box { border-radius: 3px; }
.tn-radio__dot { border-radius: 999px; }
.tn-check input, .tn-radio input { display: none; }
.tn-check.is-checked .tn-check__box { background: var(--tn-blue-500); border-color: var(--tn-blue-500); }
.tn-check.is-checked .tn-check__box::after { content: ""; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.tn-radio.is-checked .tn-radio__dot { border-color: var(--tn-blue-500); }
.tn-radio.is-checked .tn-radio__dot::after { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--tn-blue-500); }

/* ===== Toggle ===== */
.tn-toggle { width: 36px; height: 20px; background: var(--tn-steel-400); border-radius: 999px; position: relative; transition: background .15s; cursor: pointer; }
.tn-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.tn-toggle.is-on { background: var(--tn-blue-500); }
.tn-toggle.is-on::after { transform: translateX(16px); }

/* ===== Badges ===== */
.tn-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; height: 22px; font-family: var(--font-heading); font-weight: 700; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 999px; }
.tn-badge .tn-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.tn-badge--neutral { background: var(--tn-steel-200); color: var(--tn-steel-800); }
.tn-badge--info    { background: var(--tn-info-100); color: var(--tn-info-500); }
.tn-badge--success { background: var(--tn-success-100); color: var(--tn-success-500); }
.tn-badge--warning { background: var(--tn-warning-100); color: #8A6300; }
.tn-badge--error   { background: var(--tn-error-100); color: var(--tn-error-500); }
.tn-badge--brand   { background: var(--tn-blue-50); color: var(--tn-blue-700); }

/* Tier — solid, square corners feel industrial */
.tn-tier { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; font-family: var(--font-heading); font-weight: 700; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; border-radius: 2px; }
.tn-tier--platinum { background: #0B2545; color: #fff; }
.tn-tier--gold     { background: #C98A00; color: #fff; }
.tn-tier--silver   { background: #94A3B8; color: #fff; }
.tn-tier--standard { background: var(--tn-steel-200); color: var(--tn-steel-800); }

/* ===== Card ===== */
.tn-card { background: #fff; border: 1px solid var(--border-1); border-radius: 4px; overflow: hidden; }

/* ===== Table ===== */
.tn-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tn-table thead th { background: var(--tn-steel-100); color: var(--fg-2); font-family: var(--font-heading); font-weight: 700; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border-1); }
.tn-table tbody td { padding: 12px; border-bottom: 1px solid var(--tn-steel-200); color: var(--fg-1); }
.tn-table tbody tr:hover td { background: var(--tn-blue-50); }
.tn-table tbody tr.is-selected td { background: var(--tn-blue-50); }

/* ===== Alert ===== */
.tn-alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 4px; border-left: 4px solid; font-size: 13.5px; line-height: 1.45; align-items: flex-start; }
.tn-alert__icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.tn-alert__title { font-weight: 700; color: var(--fg-1); margin-bottom: 2px; }
.tn-alert--info    { background: var(--tn-info-100); border-color: var(--tn-info-500); color: #074F76; }
.tn-alert--success { background: var(--tn-success-100); border-color: var(--tn-success-500); color: #1F5E3D; }
.tn-alert--warning { background: var(--tn-warning-100); border-color: var(--tn-warning-500); color: #5C4400; }
.tn-alert--error   { background: var(--tn-error-100); border-color: var(--tn-error-500); color: #7A1E1A; }
