/* components.css — shared building blocks used on every page:
   buttons, form fields, segmented control, chips/pills, banners, toasts, confirm modal. */

/* ---- buttons ---- */
button { border: 0; border-radius: var(--radius); padding: 10px 14px; cursor: pointer; font-weight: 600; transition: transform .1s, background .15s, box-shadow .15s, border-color .15s; }
button:active { transform: scale(0.98); }
button:disabled { cursor: not-allowed; opacity: .6; }

.primary-btn, .new-chat-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--emerald); color: #fff; border: 0; border-radius: var(--radius);
  padding: 9px 16px; font-weight: 600; font-size: 0.88rem; box-shadow: var(--shadow-accent); text-decoration: none;
}
.primary-btn:hover, .new-chat-btn:hover { background: var(--emerald-deep); }
.primary-btn:disabled { opacity: .7; cursor: wait; box-shadow: none; }
.new-chat-btn { width: 100%; }

.secondary-btn {
  background: var(--surface); color: var(--ink); box-shadow: none; border: 1px solid var(--hair);
  padding: 8px 14px; font-size: 0.85rem; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.secondary-btn:hover { background: var(--tint); border-color: var(--tint-border); color: var(--emerald-deep); }

.danger-link-btn { background: transparent; color: var(--danger); border: 0; box-shadow: none; padding: 8px 10px; font-size: 0.85rem; }
.danger-link-btn:hover { background: var(--danger-tint); }

.secondary-link { background: transparent !important; color: var(--emerald-deep) !important; box-shadow: none !important; padding: 0; text-align: left; font-weight: 600; }
.secondary-link:hover { text-decoration: underline; }

.icon-btn { display: none; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 10px; background: transparent; color: var(--muted); box-shadow: none; flex-shrink: 0; }
.icon-btn:hover { background: var(--chip); color: var(--ink); }
.attach-btn { display: inline-grid; }

/* ---- form fields ---- */
label { display: flex; flex-direction: column; gap: 6px; color: var(--ink); font-weight: 600; font-size: 0.85rem; }
input, select, textarea { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--hair); background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(14, 169, 104, 0.12); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type='checkbox'], input[type='radio'] { accent-color: var(--emerald); }

/* ---- chips, pills, segmented ---- */
.pill, .session-pill { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .04em; color: var(--emerald-deep); background: var(--tint); border: 1px solid var(--tint-border); border-radius: 999px; padding: 4px 10px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); background: var(--chip); border: 1px solid var(--hair); border-radius: 999px; padding: 4px 10px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); display: inline-block; }
.eyebrow { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--emerald-deep); }

.seg { display: inline-flex; background: var(--track); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; box-shadow: none; }
.seg button:hover { color: var(--ink); }
.seg-sm button { padding: 4px 10px; font-size: 12px; }
.seg button.active { background: var(--emerald); color: #fff; box-shadow: 0 2px 8px rgba(14, 169, 104, .3); }

/* ---- banners, helper text ---- */
.status-banner { min-height: 24px; margin-bottom: 14px; font-size: 0.9rem; color: var(--emerald-deep); padding: 10px 14px; border-radius: 10px; background: var(--tint); border: 1px solid var(--tint-border); }
.status-banner.error { color: var(--danger); background: var(--danger-tint); border-color: var(--danger-border); }
.status-banner.success { color: var(--emerald-deep); background: var(--tint); border-color: var(--tint-border); }
.helper-text { margin: 0; color: var(--muted); line-height: 1.6; font-size: 0.88rem; }

/* ---- confirm modal ---- */
.confirm-modal-backdrop { position: fixed; inset: 0; background: rgba(19, 24, 21, 0.45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 200; padding: 16px; }
.confirm-modal { width: min(420px, 100%); background: var(--surface); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-pop); border: 1px solid var(--hair); }
.confirm-modal h2 { margin: 0 0 8px; font-size: 1.1rem; }
.confirm-modal p { margin: 0 0 20px; color: var(--muted); line-height: 1.55; }
.confirm-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.confirm-modal-danger-btn { background: var(--danger); color: #fff; padding: 9px 16px; font-size: 0.88rem; }
.confirm-modal-danger-btn:hover { background: #912018; }

/* ---- toasts ---- */
.toast-stack { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 300; max-width: min(380px, calc(100vw - 40px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 0.88rem; box-shadow: var(--shadow-pop); animation: toast-in .2s ease; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--emerald-deep); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.status-banner:empty { display: none; }
