/*
 * NirogMaya public site: brand tokens, header, footer and page hero.
 * One copy for every page under /public. A clinic's theme overrides the
 * colour tokens at runtime (shared/tenant.js, shared/site-profile.js).
 */
:root {
    --primary-color: #0f766e;
    --secondary-color: #115e59;
    --accent-color: #14b8a6;
    --danger-color: #dc2626;
    --text-dark: #1d2b28;
    --text-light: #5a6965;
    --bg-light: #f5f7f6;
    --surface: #ffffff;
    --line: #d9e1de;
    --brand-deep: #0b2f2c;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(16, 42, 38, .08);
    --shadow-md: 0 8px 24px rgba(16, 42, 38, .10);
    --font-sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --nm-primary: var(--primary-color);
    --nm-secondary: var(--secondary-color);
}

html { scroll-behavior: smooth; scroll-padding-top: 140px; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000; /* below page pop-ups (9999) */
    background: var(--surface);
    box-shadow: 0 1px 0 var(--line), var(--shadow-sm);
    font-family: var(--font-sans);
}
.site-header *, .site-footer * { box-sizing: border-box; }

.site-header .top-bar {
    background: var(--secondary-color);
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    color: #fff;
    font-size: .85rem;
}
.site-header .top-bar-content {
    max-width: 1240px;
    margin: 0 auto;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.site-header .top-bar-item { display: flex; align-items: center; gap: 6px; opacity: .95; }
.site-header .top-bar-spacer { margin-left: auto; }
.site-header .lang-switcher {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 6px;
    padding: 3px 6px;
    font: inherit;
    font-size: .82rem;
    cursor: pointer;
}
.site-header .lang-switcher option { color: var(--text-dark); }
.site-header [data-pwa-install][hidden] { display: none !important; }
.site-header .pwa-install-btn {
    padding: 3px 10px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
}
.site-header .pwa-install-btn:hover { background: rgba(255, 255, 255, .28); }
.site-header .pwa-install-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.site-header .emergency-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--danger-color);
    color: #fff;
    padding: 5px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .04em;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, .6);
    animation: nm-ping 2.4s infinite;
}
@keyframes nm-ping {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .55); }
    70% { box-shadow: 0 0 0 9px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .site-header .emergency-btn { animation: none; }
    html { scroll-behavior: auto; }
}

.site-header .site-nav {
    max-width: 1240px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-dark);
    min-width: 0;
    flex: 0 1 auto;
}
.site-header .logo-mark { flex: none; width: 40px; height: 40px; display: block; }
.site-header .logo-mark svg { width: 100%; height: 100%; display: block; }
.site-header .logo-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.site-header .logo-name {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: linear-gradient(90deg, var(--text-dark) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.site-header .logo-tagline {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-light);
    white-space: nowrap;
}

.site-header .nav-menu {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0 0 0 auto;
    padding: 0;
}
.site-header .nav-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
    transition: background .2s, color .2s;
}
.site-header .nav-menu a:hover { color: var(--primary-color); background: var(--bg-light); }
.site-header .nav-menu a[aria-current="page"] {
    color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
}

.site-header .nav-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.site-header #tenantSwitcherContainer:empty { display: none; }
/* The red demo notice already says this; keeps the top bar on one row. */
.site-header #tenantBadgeContainer { display: none !important; }
@media (max-width: 1400px) { .site-header .top-bar-email { display: none; } }
.site-header .top-bar #tenantSwitcherContainer select {
    max-width: 380px;
    padding: 3px 8px !important;
    font: inherit;
    font-size: .82rem !important;
    color: #fff !important;
    background: rgba(255, 255, 255, .14) !important;
    border: 1px solid rgba(255, 255, 255, .35) !important;
    border-radius: 6px !important;
}
.site-header .top-bar #tenantSwitcherContainer option { color: var(--text-dark); }

/* Brand buttons, used by the header and page content alike */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 999px;
    font: inherit;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    border: 2px solid var(--primary-color);
    transition: background .2s, color .2s, box-shadow .2s, transform .2s;
}
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--secondary-color); border-color: var(--secondary-color); color: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--primary-color); }
.btn-outline:hover { background: var(--primary-color); color: #fff; }
.btn:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }
/* Same buttons inside the header, protected from page-level .btn rules */
.site-header .btn { display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 0; padding: 8px 18px; border: 2px solid var(--primary-color); border-radius: 999px; font: inherit; font-size: .92rem; font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap; box-shadow: none; transform: none; }
.site-header .btn-primary { background: var(--primary-color); color: #fff; }
.site-header .btn-primary:hover { background: var(--secondary-color); border-color: var(--secondary-color); color: #fff; }
.site-header .btn-outline { background: transparent; color: var(--primary-color); }
.site-header .btn-outline:hover { background: var(--primary-color); color: #fff; }
.site-header a:focus-visible,
.site-header button:focus-visible,
.site-footer a:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }

/* Login dropdown */
.site-header .login-dropdown { position: relative; }
.site-header .login-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 1100;
}
.site-header .login-dropdown-menu::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.site-header .login-dropdown:hover .login-dropdown-menu,
.site-header .login-dropdown:focus-within .login-dropdown-menu,
.site-header .login-dropdown.open .login-dropdown-menu { display: block; }
.site-header .login-dropdown-menu a {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: .93rem;
}
.site-header .login-dropdown-menu a:hover { background: var(--bg-light); color: var(--primary-color); }
.site-header .login-dropdown-divider { height: 1px; background: var(--line); margin: 5px 4px; }

/* Hamburger and mobile menu */
.site-header .hamburger-btn {
    display: none;
    margin-left: auto;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    position: relative;
    z-index: 1100; /* stays above the open menu so it can close it */
}
.site-header .hamburger-btn span { display: block; height: 3px; width: 24px; border-radius: 2px; background: var(--primary-color); transition: transform .3s, opacity .3s; }
.site-header .hamburger-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.site-header .hamburger-btn.open span:nth-child(2) { opacity: 0; }
.site-header .hamburger-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.site-header .mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -340px;
    width: 310px;
    max-width: 86vw;
    height: 100vh;
    height: 100dvh;
    padding: 72px 18px calc(28px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--surface);
    box-shadow: -6px 0 24px rgba(0, 0, 0, .16);
    transition: right .3s ease;
    z-index: 1050;
}
.site-header .mobile-menu.open { right: 0; }
.site-header .mobile-menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 47, 44, .45);
    z-index: 1040;
}
.site-header .mobile-menu-backdrop.open { display: block; }
.site-header .mobile-menu-links { list-style: none; margin: 0 0 14px; padding: 0; }
.site-header .mobile-menu-links li { border-bottom: 1px solid var(--line); }
.site-header .mobile-menu-links li:last-child { border-bottom: 0; }
.site-header .mobile-menu-links a { display: block; padding: 12px 6px; color: var(--text-dark); text-decoration: none; font-weight: 600; }
.site-header .mobile-menu-links a[aria-current="page"] { color: var(--primary-color); }
.site-header .mobile-menu-links a.mobile-menu-emergency { color: var(--danger-color); }
.site-header .mobile-menu-book { display: flex; width: 100%; margin-bottom: 16px; padding: 12px; }
.site-header .mobile-menu-section { border-top: 1px solid var(--line); padding-top: 14px; }
.site-header .mobile-menu-label { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-light); margin-bottom: 10px; }
.site-header .mobile-menu-roles { display: flex; flex-direction: column; gap: 6px; }
.site-header .mobile-menu-roles a { padding: 10px 14px; border-radius: 10px; background: var(--bg-light); color: var(--text-dark); text-decoration: none; font-weight: 600; }
.site-header .mobile-menu-roles a:hover { color: var(--primary-color); }
.site-header .mobile-menu .lang-switcher { width: 100%; margin-top: 14px; padding: 8px; color: var(--text-dark); background: var(--bg-light); border-color: var(--line); }

@media (max-width: 1080px) {
    .site-header .nav-menu, .site-header .nav-actions { display: none; }
    .site-header .hamburger-btn { display: flex; }
    .site-header .mobile-menu { display: block; }
    .site-header .site-nav { padding: 10px 16px; }
    .site-header .top-bar-content { padding: 5px 16px; gap: 10px; }
    .site-header .top-bar-collapsible { display: none !important; }
    .site-header .top-bar .lang-switcher { display: none; }
    .site-header .logo-name { white-space: normal; font-size: 1.05rem; }
}
@media (max-width: 420px) {
    .site-header .logo-mark { width: 34px; height: 34px; }
    .site-header .logo-tagline { display: none; }
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    text-align: center;
    padding: 48px 20px 52px;
}
.page-hero::after {
    content: "";
    position: absolute;
    inset: auto -10% -60% auto;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .14), transparent);
    pointer-events: none;
}
.page-hero h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 3.6vw, 2.6rem); line-height: 1.2; color: #fff; }
.page-hero p { margin: 0 auto; max-width: 680px; font-size: 1.08rem; color: rgba(255, 255, 255, .92); }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--brand-deep);
    background: linear-gradient(180deg, color-mix(in srgb, var(--secondary-color) 35%, #0b1f1d), #0b1f1d);
    color: #cfe0dc;
    font-family: var(--font-sans);
    font-size: .95rem;
    padding: 56px 20px 24px;
}
.site-footer .footer-content {
    max-width: 1240px;
    margin: 0 auto 32px;
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 36px;
}
.site-footer h3 { margin: 0 0 14px; font-size: 1rem; color: #fff; letter-spacing: .02em; }
.site-footer h3 a { color: inherit; text-decoration: none; }
.site-footer p { margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: #cfe0dc; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.site-footer .footer-brand .logo-mark { width: 36px; height: 36px; flex: none; }
.site-footer .footer-brand .logo-mark svg { width: 100%; height: 100%; display: block; }
.site-footer .footer-brand h3 { margin: 0; font-size: 1.15rem; }
.site-footer .footer-bottom {
    max-width: 1240px;
    margin: 0 auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    font-size: .85rem;
    color: #9fb8b3;
}
.site-footer .footer-bottom p { margin: 0; }
@media (max-width: 900px) { .site-footer .footer-content { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .site-footer .footer-content { grid-template-columns: 1fr; gap: 24px; } .site-footer { padding-top: 40px; } }

/* Breadcrumb trail (shared/breadcrumbs.js places it inside the header) */
.site-header #nmBreadcrumbs,
.site-header #nmBreadcrumbs.nm-auto {
    background: var(--bg-light);
    color: var(--text-light);
    border-top: 1px solid var(--line);
    border-bottom: 0;
    padding: 6px max(20px, calc((100% - 1200px) / 2));
    font-family: var(--font-sans);
}
.site-header #nmBreadcrumbs a { color: var(--primary-color); }
.site-header #nmBreadcrumbs [aria-current] { color: var(--text-dark); }

/* ---------- Sign-in style pages (forgot/reset password, invitations, register) ---------- */
.auth-shell {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px 64px;
    background:
        radial-gradient(900px 420px at 10% -10%, color-mix(in srgb, var(--primary-color) 18%, transparent), transparent),
        radial-gradient(700px 380px at 110% 110%, color-mix(in srgb, var(--accent-color) 14%, transparent), transparent),
        var(--bg-light);
}
.auth-shell > * { width: 100%; }
.btn-block { display: flex; width: 100%; border-radius: 10px; padding: 13px 18px; font-size: 1rem; }
.btn:disabled, .btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
