/* ClinicPay App — shared styles
   Imports the design tokens from the parent site,
   then adds app-specific layout and component styles. */

@import url("../colors_and_type.css");

/* Reset */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Geist', system-ui, sans-serif; color: var(--ink-800); background: var(--saline-100); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }

.serif { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; }
.mono { font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* ===== Buttons ===== */
.btn { padding: 10px 16px; border-radius: 6px; border: 1px solid transparent; font-size: 14px; font-weight: 500; transition: background 0.1s, border-color 0.1s; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--ink-700); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--ink-800); }
.btn-purple { background: #7B3F8C; color: #fff; }
.btn-purple:hover:not(:disabled) { background: #6A347A; }
.btn-secondary { background: #fff; border-color: var(--saline-300); color: var(--ink-700); }
.btn-secondary:hover:not(:disabled) { background: var(--saline-50); }
.btn-ghost { background: transparent; color: var(--scrub-600); border: none; }
.btn-ghost:hover:not(:disabled) { background: var(--saline-50); }
.btn-danger { background: var(--alert-500); color: #fff; }
.btn-large { padding: 13px 24px; font-size: 15px; }
.btn-small { padding: 5px 11px; font-size: 12px; }

/* ===== Inputs ===== */
.input, .field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--saline-300); border-radius: 6px;
  font-size: 14px; background: #fff; transition: border-color 0.1s, box-shadow 0.1s;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--scrub-500); box-shadow: 0 0 0 3px var(--scrub-100);
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-700); margin-bottom: 5px; }
.field-hint { font-size: 12px; color: var(--saline-600); margin-top: 4px; }
.field-error { font-size: 12px; color: var(--alert-500); margin-top: 4px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ===== Cards ===== */
.card { background: #fff; border: 1px solid var(--saline-200); border-radius: 8px; overflow: hidden; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--saline-200); display: flex; justify-content: space-between; align-items: center; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink-800); }
.card-body { padding: 20px; }

/* ===== Headers ===== */
.h1 { font-family: 'Instrument Serif', Georgia, serif; font-size: 36px; letter-spacing: -0.01em; margin: 0; line-height: 1.1; }
.h1 em { font-style: italic; color: var(--scrub-500); }
.h2 { font-family: 'Instrument Serif', Georgia, serif; font-size: 26px; margin: 0; }
.h2 em { font-style: italic; color: var(--scrub-500); }
.sub { color: var(--saline-600); margin: 6px 0 0; font-size: 14px; line-height: 1.5; }
.label { font-size: 11px; color: var(--saline-600); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }

/* ===== Tables ===== */
table { width: 100%; border-collapse: collapse; }
table th { text-align: left; padding: 10px 20px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--saline-600); border-bottom: 1px solid var(--saline-200); font-weight: 500; background: var(--saline-50); }
table td { padding: 14px 20px; border-bottom: 1px solid var(--saline-100); font-size: 14px; vertical-align: middle; }
table tr:last-child td { border-bottom: none; }
table tr.clickable { cursor: pointer; transition: background 0.1s; }
table tr.clickable:hover td { background: var(--saline-50); }
table tr.highlight td { background: #FFF7ED; }

/* ===== Status pills ===== */
.status { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 500; }
.s-paid { background: var(--vital-50); color: var(--vital-700); }
.s-sent { background: var(--scrub-50); color: var(--scrub-700); }
.s-viewed { background: var(--scrub-100); color: var(--scrub-800); }
.s-pending { background: #FEF3C7; color: #92400E; }
.s-overdue { background: #FECACA; color: #991B1B; }
.s-draft { background: var(--saline-100); color: var(--saline-700); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.p-inperson { background: #FAF5FF; color: #7B3F8C; border: 1px solid #E9D5FF; }
.p-link { background: var(--scrub-50); color: var(--scrub-700); border: 1px solid var(--scrub-100); }
.p-autopay { background: var(--vital-50); color: var(--vital-700); border: 1px solid var(--vital-100); }
.p-card-on-file { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.p-ach-on-file { background: #DBEAFE; color: #1E40AF; border: 1px solid #93C5FD; }

/* ===== Modals & panels ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(11, 24, 44, 0.5); display: none; align-items: center; justify-content: center; z-index: 100; padding: 24px; animation: fadeIn 0.15s; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 540px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 25px 60px rgba(0,0,0,0.25); animation: slideUp 0.2s; }
.modal-head { padding: 20px 28px; border-bottom: 1px solid var(--saline-200); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; font-family: 'Instrument Serif', Georgia, serif; font-size: 24px; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--saline-500); cursor: pointer; padding: 4px 10px; border-radius: 4px; }
.modal-close:hover { background: var(--saline-100); }
.modal-body { padding: 24px 28px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 16px 28px; border-top: 1px solid var(--saline-200); display: flex; justify-content: flex-end; gap: 8px; background: var(--saline-50); }

.panel-overlay { position: fixed; inset: 0; background: rgba(11, 24, 44, 0.4); display: none; align-items: stretch; justify-content: flex-end; z-index: 90; animation: fadeIn 0.15s; }
.panel-overlay.open { display: flex; }
.panel { background: #fff; width: 480px; max-width: 100%; overflow-y: auto; box-shadow: -10px 0 30px rgba(0,0,0,0.2); animation: slideLeft 0.2s; display: flex; flex-direction: column; }
.panel-head { padding: 20px 24px; border-bottom: 1px solid var(--saline-200); display: flex; justify-content: space-between; align-items: center; }
.panel-body { padding: 24px; flex: 1; }
.panel-foot { padding: 16px 24px; border-top: 1px solid var(--saline-200); display: flex; justify-content: space-between; gap: 8px; background: var(--saline-50); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideLeft { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== Toasts ===== */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink-800); color: #fff; padding: 12px 16px; border-radius: 6px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.2); display: flex; align-items: center; gap: 10px; min-width: 240px; animation: slideIn 0.2s; }
.toast-success { background: var(--vital-600); }
.toast-error { background: var(--alert-500); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== Loading ===== */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ===== Empty states ===== */
.empty-state { padding: 48px 24px; text-align: center; color: var(--saline-600); }
.empty-state-icon { font-size: 48px; opacity: 0.3; margin-bottom: 12px; }
.empty-state-title { font-size: 16px; color: var(--ink-700); margin-bottom: 4px; }
.empty-state-sub { font-size: 13px; }

/* ===== Pulse callout for tutorial moments ===== */
.callout-pulse {
  box-shadow: 0 0 0 0 rgba(123, 63, 140, 0.6);
  animation: callout-pulse 2s infinite;
}
@keyframes callout-pulse {
  0% { box-shadow: 0 0 0 0 rgba(123, 63, 140, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(123, 63, 140, 0); }
  100% { box-shadow: 0 0 0 0 rgba(123, 63, 140, 0); }
}

/* ===== Utility ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--saline-600); }
.text-purple { color: #7B3F8C; }
.text-vital { color: var(--vital-600); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden { display: none; }

/* ===== Brand mark (clinic logo placeholder) ===== */
.brand-mark { width: 36px; height: 36px; background: #7B3F8C; color: #fff; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-family: 'Instrument Serif', Georgia, serif; font-size: 18px; flex-shrink: 0; }
.brand-mark-sm { width: 28px; height: 28px; font-size: 14px; }
.brand-mark-lg { width: 56px; height: 56px; font-size: 26px; border-radius: 10px; }

/* ===== Avatars ===== */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--scrub-500); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; flex-shrink: 0; }
