/* Shared visual foundation. This file changes presentation only. */

/* Clinical workspaces */
:root {
    --ui-page: #f4f7fb;
    --ui-border: #e6ebf2;
    --ui-text: #172235;
    --ui-muted: #607087;
}

#appSidebar {
    box-shadow: 8px 0 28px rgba(15, 23, 42, .08);
}
.sb-nav { padding: 16px 11px; }
.sb-section-label { letter-spacing: .12em; }
.nav-link, .sb-action { border-radius: 10px; min-height: 40px; }
.nav-link:focus-visible, .sb-action:focus-visible, .mobile-menu-btn:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 2px;
}
.topbar {
    height: 64px;
    background: rgba(255, 255, 255, .97);
    border-bottom-color: var(--border);
}
.topbar-title { letter-spacing: -.025em; }
.topbar-tag { padding: 5px 12px; }
.content-area {
    background: var(--ui-page);
    color: var(--ui-text);
    padding: 30px 36px;
}
.kpi-grid { gap: 16px; }
.kpi-card {
    border-radius: 16px;
    border-color: var(--ui-border);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .025);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.kpi-card:hover {
    transform: translateY(-2px);
    border-color: #cbd8e9;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .075);
}
.kpi-icon { border-radius: 12px; }
.panel {
    border-radius: 16px;
    border-color: var(--ui-border);
    box-shadow: 0 3px 12px rgba(15, 23, 42, .035);
}
.panel-head { background: #fbfcfe; padding: 17px 22px; }
.panel-title { letter-spacing: -.01em; }
.finput {
    min-height: 42px;
    background: #fbfcfe;
    border-radius: 10px;
    border-color: #dce4ee;
    font-weight: 500;
}
.finput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}
.finput::placeholder { color: #98a5b6; font-weight: 400; }
.btn {
    border-radius: 10px;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.btn-sm { min-height: 34px; }
.btn-md { min-height: 40px; }
.btn-lg { min-height: 46px; }
.btn-primary:hover, .btn-secondary:hover { box-shadow: 0 4px 12px rgba(15, 23, 42, .1); }
.btn:focus-visible, .modal-close-btn:focus-visible, .rx-tab-btn:focus-visible, .fc-button:focus-visible {
    outline: 3px solid var(--accent-light) !important;
    outline-offset: 2px;
}
.btn:disabled, .btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .58;
    transform: none;
    box-shadow: none;
}
.dtable thead th {
    background: #f7f9fc;
    padding-top: 13px;
    padding-bottom: 13px;
    letter-spacing: .075em;
}
.dtable tbody tr { border-bottom-color: #edf1f6; }
.dtable tbody tr:hover { background: #f7f9fd; }
.dtable tbody td { line-height: 1.45; }
.modal-box {
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 18px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
}
.modal-hd { padding-top: 20px; padding-bottom: 20px; }
.modal-ft { background: #fafbfd; }
.modal-close-btn { width: 36px; height: 36px; border-radius: 10px; }
.rx-tabs-nav { background: #fbfcfe; }
.rx-tab-btn { border-radius: 9px 9px 0 0; }
.mobile-menu-btn {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    transition: background-color .16s ease;
}
.mobile-menu-btn:hover { background: var(--accent-light); }
.cs::-webkit-scrollbar { width: 8px; height: 8px; }
.cs::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Sign in */
body.bg-slate-900 {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, .2), transparent 46%),
        linear-gradient(150deg, #0b1220, #111d34 58%, #0f172a);
    -webkit-font-smoothing: antialiased;
}
body > div.bg-white.rounded-3xl.shadow-2xl {
    border: 1px solid rgba(226, 232, 240, .85);
    border-radius: 24px;
    box-shadow: 0 26px 80px rgba(2, 6, 23, .32);
}
body > div.bg-white.rounded-3xl.shadow-2xl input {
    min-height: 48px;
    border-radius: 12px;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
body > div.bg-white.rounded-3xl.shadow-2xl input:focus {
    background: #fff;
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .14);
}
body > div.bg-white.rounded-3xl.shadow-2xl button[type="submit"] {
    min-height: 48px;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .2);
}
body > div.bg-white.rounded-3xl.shadow-2xl button:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}
.verification-panel {
    padding: 26px 22px 22px;
    border: 1px solid #e3eafa;
    border-radius: 20px;
    background: linear-gradient(160deg, #f8fbff, #fff 68%);
    text-align: center;
    animation: slideIn .24s ease-out;
}
.verification-icon {
    display: grid;
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    place-items: center;
    border: 1px solid #dbeafe;
    border-radius: 20px;
    background: #eff6ff;
    font-size: 28px;
}
.verification-eyebrow {
    margin: 0 0 7px;
    color: #2563eb;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
}
.verification-panel h2 {
    margin: 0;
    color: #172235;
    font-size: 23px;
    font-weight: 850;
    letter-spacing: -.035em;
}
.verification-copy {
    margin: 11px 0 15px;
    color: #607087;
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.verification-copy strong { color: #263449; }
.verification-notice {
    margin: 0 0 14px;
    padding: 11px 13px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 13px;
    line-height: 1.5;
}
.verification-tips {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    margin: 0 0 18px;
    color: #66758a;
    font-size: 12px;
}
.verification-tips span { color: #16a34a; font-weight: 900; }
.verification-actions { display: grid; gap: 9px; }
.verification-primary-button, .verification-secondary-button {
    width: 100%;
    min-height: 45px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.verification-primary-button {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 7px 16px rgba(37, 99, 235, .17);
}
.verification-primary-button:hover { background: #1d4ed8; transform: translateY(-1px); }
.verification-secondary-button { border: 1px solid #e2e8f0; background: #fff; color: #475569; }
.verification-secondary-button:hover { background: #f8fafc; }
.verification-resend-form {
    display: grid;
    gap: 9px;
    margin: 0 0 14px;
    text-align: left;
}
.verification-resend-form label { color: #475569; font-size: 12px; font-weight: 700; }
.verification-resend-form input {
    width: 100%;
    min-height: 45px;
    padding: 10px 12px;
    border: 1px solid #d8e1ed;
    border-radius: 11px;
    background: #fff;
    color: #172235;
}
.verification-resend-form input:focus { border-color: #60a5fa; outline: 3px solid rgba(59, 130, 246, .14); }
.verification-primary-button:disabled { cursor: wait; opacity: .65; }
.verification-cancel {
    margin-top: 11px;
    border: 0;
    background: transparent;
    color: #64748b;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.verification-panel button:focus-visible, .verification-resend-form input:focus-visible {
    outline: 3px solid rgba(59, 130, 246, .32);
    outline-offset: 2px;
}

/* Public booking */
body.text-slate-800:has(#bookingApp) {
    color: #172235;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, .07), transparent 48%),
        #f6f8fc;
    -webkit-font-smoothing: antialiased;
}
#bookingApp > div {
    border-radius: 18px;
    border-color: #e7ecf3;
    box-shadow: 0 5px 18px rgba(15, 23, 42, .045);
    transition: box-shadow .18s ease, border-color .18s ease;
}
#bookingApp > div:focus-within {
    border-color: rgba(99, 102, 241, .28);
    box-shadow: 0 9px 26px rgba(15, 23, 42, .07);
}
#bookingApp input, #bookingApp select, #bookingApp textarea {
    border-radius: 12px;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
#bookingApp input:focus, #bookingApp select:focus, #bookingApp textarea:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .13);
}
#bookingApp button:focus-visible {
    outline: 3px solid rgba(99, 102, 241, .3);
    outline-offset: 2px;
}

/* Billing portal */
body.bg-slate-50 {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, .07), transparent 48%),
        #f6f8fc;
    -webkit-font-smoothing: antialiased;
}
#mainContainer .bg-white.rounded-3xl {
    border-color: #e7ecf3;
}
#mainContainer input, #mainContainer select {
    min-height: 44px;
    border-radius: 11px;
    transition: border-color .16s ease, box-shadow .16s ease;
}
#mainContainer input:focus, #mainContainer select:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .13);
}
#mainContainer button:focus-visible, body:has(#mainContainer) nav button:focus-visible {
    outline: 3px solid rgba(129, 140, 248, .5);
    outline-offset: 2px;
}

/* Administrator access */
body.bg-slate-900:has(#loginAdminView) {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(37, 99, 235, .12), transparent 48%),
        #0b1220;
}
#loginAdminView > div {
    border-radius: 18px;
    border-color: #334155;
    box-shadow: 0 24px 70px rgba(2, 6, 23, .32);
}
#adminLoginForm input {
    min-height: 48px;
    border-radius: 11px;
    transition: border-color .16s ease, box-shadow .16s ease;
}
#adminLoginForm input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .16);
}
#adminLoginForm button:focus-visible, #adminLoginForm input:focus-visible {
    outline: 3px solid rgba(96, 165, 250, .42);
    outline-offset: 2px;
}
#dashboardAdminView main > .grid > div {
    border-radius: 14px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
#dashboardAdminView main > .grid > div:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(2, 6, 23, .2);
}
#dashboardAdminView #viewClinicas, #dashboardAdminView #viewVendedores {
    border-color: #334155;
    border-radius: 16px;
}
#dashboardAdminView .overflow-x-auto tbody tr {
    border-bottom: 1px solid rgba(71, 85, 105, .45);
    transition: background-color .15s ease;
}
#dashboardAdminView .overflow-x-auto tbody tr:hover { background: rgba(51, 65, 85, .45); }
#dashboardAdminView button:focus-visible, #dashboardAdminView input:focus-visible, #dashboardAdminView select:focus-visible {
    outline: 3px solid rgba(96, 165, 250, .45);
    outline-offset: 2px;
}

/* Partner portal */
#loginView > div {
    border-color: #e7ecf3;
    border-radius: 20px;
    box-shadow: 0 18px 55px rgba(15, 23, 42, .09);
}
#loginForm input {
    min-height: 48px;
    border-radius: 12px;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
#loginForm input:focus {
    background: #fff;
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .13);
}
#loginForm button { min-height: 48px; border-radius: 12px; }
#loginForm button:focus-visible, #loginForm input:focus-visible {
    outline: 3px solid rgba(99, 102, 241, .35);
    outline-offset: 2px;
}

/* Privacy page */
body:has(> .max-w-4xl) {
    color: #263449;
    background: #f6f8fc;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
body > .max-w-4xl {
    border-color: #e5ebf3;
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .055);
}
body:has(> .max-w-4xl) a { text-underline-offset: 3px; }
body:has(> .max-w-4xl) a:focus-visible {
    outline: 3px solid rgba(59, 130, 246, .35);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Existing marketing page already has its own visual system */
body:has(.btn-primary):not(:has(#appSidebar)):not(:has(#bookingApp)) :focus-visible {
    outline: 3px solid rgba(167, 139, 250, .8);
    outline-offset: 3px;
}

/* Meta onboarding utility */
body:has(.btn-whatsapp) {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 0;
    padding: 36px 20px;
    color: #172235;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(37, 211, 102, .1), transparent 48%),
        #f6f8fc;
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
body:has(.btn-whatsapp) h1 { max-width: 720px; margin: 0; font-size: clamp(1.6rem, 4vw, 2.5rem); line-height: 1.2; }
body:has(.btn-whatsapp) p { max-width: 560px; margin: 0; color: #607087; }
.btn-whatsapp {
    min-height: 50px;
    padding: 14px 24px;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(18, 140, 126, .2);
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.btn-whatsapp:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(18, 140, 126, .24); }
.btn-whatsapp:focus-visible { outline: 3px solid rgba(18, 140, 126, .35); outline-offset: 3px; }

@media (max-width: 768px) {
    .topbar { height: 58px; }
    .content-area { padding: 18px 16px 24px; }
    .panel-head { padding: 15px 17px; }
}
@media (max-width: 600px) {
    #mainContainer { padding-top: 24px; }
    body:has(#mainContainer) nav > div { padding-left: 16px !important; padding-right: 16px !important; }
    body:has(#mainContainer) nav h1 { font-size: 1rem !important; }
    body:has(> .max-w-4xl) { padding: 20px 14px !important; }
    body > .max-w-4xl { padding: 22px !important; }
}
@media (max-width: 480px) {
    body > div.bg-white.rounded-3xl.shadow-2xl {
        padding: 24px !important;
        border-radius: 20px;
    }
    #bookingApp > div { border-radius: 16px; padding: 18px !important; }
    #loginAdminView > div { padding: 24px !important; border-radius: 16px; }
    #loginView > div { padding: 24px !important; border-radius: 18px; }
    .content-area { padding: 14px 12px 20px; }
    .kpi-card { padding: 18px; }
    .panel-head { padding: 14px; }
    .panel-body { padding: 16px 14px; }
    .modal-wrap { padding: 10px; }
    .modal-box { max-height: calc(100vh - 20px) !important; }
    .modal-hd { padding: 14px 16px; }
    .modal-bd { padding: 16px; }
    .modal-ft { padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
[hidden] {
  display: none !important;
}

.subscription-badge--trial {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.2), rgba(37, 99, 235, 0.16)) !important;
  border-color: rgba(251, 191, 36, 0.5) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.12);
}
