/* ============================================================
   Pregmune Patient Portal — page-scoped theme
   Matches the new brand deployed on www-prod.pregmune.com:
   dark teal + peach palette, Cormorant Garamond display type,
   DM Sans body type, soft rounded cards and pill buttons.

   Load this file LAST (after bootstrap / Site / StyleSheet1)
   so its rules win the cascade. `!important` is used only
   where the legacy markup carries inline styles or JS-driven
   hover colors that would otherwise override the theme.
   Scope: QuestionnaireList, TemplateList, QuestionList pages.
   DocumentList-specific overrides: document-list.css
   MessageList-specific overrides: message-list.css
   ============================================================ */

:root {
    --pm-teal: #00394a;
    --pm-teal-soft: #0d4a5c;
    --pm-teal-ink: #123c49;
    --pm-slate: #3d5d68;
    --pm-peach: #f4c4bb;
    --pm-peach-deep: #e8a090;
    --pm-peach-tint: #fdf1ee;
    --pm-peach-row: #fbe4de;
    --pm-mist: #eef4f6;
    --pm-line: #dde8eb;
    --pm-card: #ffffff;
    --pm-font-serif: 'Cormorant Garamond', Georgia, serif;
    --pm-font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
    --pm-radius: 18px;
    --pm-radius-sm: 10px;
    /* Aliases used by portal-nav (Site.css) and legacy markup */
    --teal: var(--pm-teal);
    --peach: var(--pm-peach);
    --peach-deep: var(--pm-peach-deep);
    --font-serif: var(--pm-font-serif);
    --font-sans: var(--pm-font-sans);
}

/* ── Page canvas ─────────────────────────────────────────── */

body {
    background-color: #faf9f8 !important;
    font-family: var(--pm-font-sans);
    color: var(--pm-teal-ink);
    -webkit-font-smoothing: antialiased;
}

.container.body-content {
    width: 100%;
    max-width: 1240px;
    padding-top: 5px;
    padding-bottom: 10px;
}

/* Page title sits on the page canvas, above the card */
.container.body-content > h2 {
    font-family: var(--pm-font-serif);
    font-weight: 400;
    font-size: 36px;
    line-height: 1.15;
    color: var(--pm-teal);
    margin: 6px 0 22px;
    border: none;
    background: none;
    transform: none;
}

/* ── Content card ────────────────────────────────────────── */

.BkgndContent {
    background: var(--pm-card) !important;
    border-radius: var(--pm-radius);
    padding: 34px 38px 38px;
    box-shadow: 0 18px 44px rgba(0, 20, 27, .28);
    font-size: 16px;
    line-height: 1.55;
    color: var(--pm-slate);
}

/* Breadcrumb trail (first block inside the card) */
.BkgndContent > div:first-child {
    font-size: 13.5px;
    letter-spacing: .02em;
    color: var(--pm-slate);
}

.BkgndContent > div:first-child a {
    color: var(--pm-teal);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--pm-peach);
    padding-bottom: 1px;
    transition: color .15s, border-color .15s;
}

.BkgndContent > div:first-child a:hover {
    color: var(--pm-peach-deep);
    border-color: var(--pm-peach-deep);
}

/* ── Links ───────────────────────────────────────────────── */

.BkgndContent a,
.LinkSmall a,
a.LinkSmall {
    color: var(--pm-teal);
    font-weight: 500;
    text-decoration: none;
    transition: color .15s;
}

.BkgndContent a:hover,
.LinkSmall a:hover,
a.LinkSmall:hover {
    color: var(--pm-peach-deep);
    text-decoration: none;
}

/* ── Data tables (ASP.NET GridViews) ─────────────────────── */

.BkgndContent table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
    border: 1px solid var(--pm-line);
    border-radius: 14px;
    overflow: hidden;
    color: var(--pm-teal-ink) !important;
    font-family: var(--pm-font-sans);
}

/* Header row — the legacy markup hard-codes #85A3C2 inline */
.BkgndContent table tr[style*="85A3C2"],
.BkgndContent table thead tr {
    background-color: var(--pm-teal) !important;
}

.BkgndContent table th {
    padding: 12px 16px;
    font-size: 11.5px !important;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .92);
    border: none;
}

.BkgndContent table th a {
    color: rgba(255, 255, 255, .92) !important;
    text-decoration: none;
}

.BkgndContent table th a:hover {
    color: var(--pm-peach) !important;
}

/* Body rows — beat inline zebra colors and the JS
   onmouseover/onmouseout handlers that set inline styles */
.BkgndContent table tr.Dark,
.BkgndContent table tr.Light {
    background-color: #fff !important;
}

.BkgndContent table tr.Dark {
    background-color: #f7fafb !important;
}

.BkgndContent table tr.Dark:hover,
.BkgndContent table tr.Light:hover {
    background-color: var(--pm-peach-tint) !important;
}

.BkgndContent table td {
    padding: 13px 16px;
    border-top: 1px solid var(--pm-line);
    font-size: 15px;
    vertical-align: top;
}

/* Row highlighted as the current category / conversation */
.BkgndContent table tr.row-current,
.BkgndContent table tr.row-current:hover {
    background-color: var(--pm-peach-row) !important;
}

.BkgndContent table tr.row-current > td:first-child {
    border-left: 3px solid var(--pm-peach-deep);
    padding-left: 13px;
}

/* Question-group separators */
.BkgndContent table tr.row-separator {
    border-top: 10px solid var(--pm-mist) !important;
}

.BkgndContent table tr[style*="border-top"] > td {
    border-top: 10px solid var(--pm-mist) !important;
}

/* Question label column */
.TextNarrow {
    color: var(--pm-teal-ink);
    font-weight: 500;
}

/* ── Form controls ───────────────────────────────────────── */

.InputBox,
.DropDownList,
.BkgndContent input[type="text"],
.BkgndContent textarea,
.BkgndContent select {
    font-family: var(--pm-font-sans);
    font-size: 14px;
    color: var(--pm-teal-ink);
    background-color: #fff;
    border: 1px solid #c9d8dc;
    border-radius: var(--pm-radius-sm);
    padding: 7px 12px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.InputBox:focus,
.DropDownList:focus,
.BkgndContent input[type="text"]:focus,
.BkgndContent textarea:focus,
.BkgndContent select:focus {
    border-color: var(--pm-teal-soft);
    box-shadow: 0 0 0 3px rgba(232, 160, 144, .35);
}

.InputBox::placeholder,
.BkgndContent input::placeholder {
    color: #9db4bb;
}

.DropDownList,
.BkgndContent select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%2300394a' stroke-width='1.6' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

/* ── Buttons ─────────────────────────────────────────────── */

.Button,
.BkgndContent input[type="submit"],
.BkgndContent input[type="button"],
.BkgndContent button:not(.pnav-toggle) {
    display: inline-block;
    font-family: var(--pm-font-sans);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
    color: #fff !important;
    background: var(--pm-teal) !important;
    border: none;
    border-radius: 30px;
    padding: 12px 30px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 57, 74, .25);
    transition: background .2s, transform .15s, box-shadow .2s;
}

.Button:hover,
.BkgndContent input[type="submit"]:hover,
.BkgndContent input[type="button"]:hover {
    background: var(--pm-peach-deep) !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(232, 160, 144, .45);
}

.Button:active,
.BkgndContent input[type="submit"]:active {
    transform: translateY(0);
}

.Button:focus-visible,
.BkgndContent input[type="submit"]:focus-visible {
    outline: 3px solid var(--pm-peach);
    outline-offset: 2px;
}

/* ── Validation / warnings ───────────────────────────────── */

.Warning {
    font-family: var(--pm-font-sans);
    font-size: 13px;
    font-weight: 500;
    color: #b23a2f;
    background: #fdecea;
    border-left: 3px solid #b23a2f;
    border-radius: 6px;
    padding: 6px 10px;
    margin: 6px 0;
}

/* ── Messages: conversation bubbles ──────────────────────────
   The page defines .app1/.app2/.frame in an inline <style>
   block inside the body, so these selectors carry extra
   specificity (.BkgndContent prefix) to win the cascade. */

.BkgndContent .frame {
    border-radius: 16px;
    padding: 14px 18px 12px;
    margin: 4px 0;
}

/* Clinic messages */
.BkgndContent .app1.frame {
    background-color: var(--pm-mist);
    border: 1px solid var(--pm-line);
    border-bottom-left-radius: 4px;
}

/* Patient messages */
.BkgndContent .app2.frame {
    background-color: var(--pm-peach-tint);
    border: 1px solid #f5ded7;
    border-bottom-right-radius: 4px;
}

/* Timestamps inside bubbles */
.BkgndContent .frame div[style*="font-size:10px"] {
    font-size: 11px !important;
    color: #7c959d;
    letter-spacing: .02em;
}

/* Message rows shouldn't look like table rows */
.BkgndContent .frame + td,
.BkgndContent table tr > td:only-child:has(.frame) {
    border-top: none;
}

/* Compact buttons inside bubbles */
.BkgndContent .frame .Button,
.BkgndContent .frame input[type="submit"] {
    padding: 8px 18px;
    font-size: 13px;
    box-shadow: none;
}

/* ── Documents: file rows (.Rangex cells) ────────────────── */

.BkgndContent td.Rangex b {
    font-weight: 700;
    color: var(--pm-teal-ink);
}

.BkgndContent td.Rangex .LinkSmall,
.BkgndContent td.Rangex a {
    font-size: 13.5px;
}

/* Section labels above document tables (plain 16px divs) */
.BkgndContent > div[style*="font-size:16px"]:not([style*="float"]) {
    font-family: var(--pm-font-serif);
    font-size: 22px !important;
    font-weight: 600;
    color: var(--pm-teal);
    margin: 6px 0 4px;
}

/* ── MessageView: reply compose box ──────────────────────────
   The textarea reuses the bubble classes (.app2.frame) and an
   inline <style> gives it a dark-red border; restore it to a
   proper brand-styled input. */

.BkgndContent textarea.frame,
.BkgndContent textarea {
    background-color: #fff;
    color: var(--pm-teal-ink);
    border: 1px solid #c9d8dc;
    border-radius: var(--pm-radius-sm);
    min-height: 140px;
    max-width: 100%;
    padding: 12px 14px;
    font-size: 14.5px;
    line-height: 1.5;
    resize: vertical;
}

.BkgndContent textarea.frame:focus,
.BkgndContent textarea:focus {
    border-color: var(--pm-teal-soft);
    box-shadow: 0 0 0 3px rgba(232, 160, 144, .35);
}

/* Quoted-message preview title */
.BkgndContent b {
    color: var(--pm-teal-ink);
}

/* ── Upload page: file input & retention fine print ──────────
   Overrides the inline green .file-upload-button style. */

.BkgndContent .file-upload-button,
.BkgndContent input[type="file"] {
    background-color: var(--pm-mist);
    color: var(--pm-slate);
    border: 1.5px dashed #a9c2ca;
    border-radius: var(--pm-radius-sm);
    padding: 10px 14px;
    font-family: var(--pm-font-sans);
    font-size: 14px !important;
    max-width: 100%;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.BkgndContent .file-upload-button:hover,
.BkgndContent input[type="file"]:hover {
    border-color: var(--pm-peach-deep);
    background-color: var(--pm-peach-tint);
}

.BkgndContent input[type="file"]::file-selector-button {
    font-family: var(--pm-font-sans);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--pm-teal);
    border: none;
    border-radius: 20px;
    padding: 7px 16px;
    margin-right: 12px;
    cursor: pointer;
    transition: background .2s;
}

.BkgndContent input[type="file"]::file-selector-button:hover {
    background: var(--pm-peach-deep);
}

/* Helper text under the file input */
#ctl00_MainContent_lblMessage {
    font-size: 12.5px;
    color: #7c959d;
}

/* Retention-policy fine print */
.BkgndContent > div[style*="font-size:11px"] {
    font-size: 12.5px !important;
    line-height: 1.6;
    color: var(--pm-slate);
    background: var(--pm-mist);
    border-radius: 14px;
    padding: 20px 24px;
    margin-top: 10px;
}

.BkgndContent > div[style*="font-size:11px"] > strong {
    display: block;
    font-family: var(--pm-font-serif);
    font-size: 19px;
    font-weight: 600;
    color: var(--pm-teal);
    margin-bottom: 4px;
}

.BkgndContent > div[style*="font-size:11px"] li {
    margin-bottom: 8px;
}

.BkgndContent > div[style*="font-size:11px"] li strong {
    color: var(--pm-teal-ink);
}

/* Standalone auth pages (Login, PasswordReset, PasswordNew, LoginHelp) */
.pm-login footer,
.pm-login footer .Copyright,
.pm-password-reset footer,
.pm-password-reset footer .Copyright,
.pm-password-new footer,
.pm-password-new footer .Copyright,
.pm-login-help footer,
.pm-login-help footer .Copyright,
footer:not(.pfooter) .Copyright,
footer:not(.pfooter) .copyright {
    color: #646464;
}

/* ── Small screens ───────────────────────────────────────── */

@media (max-width: 700px) {
    body {
        padding-left: 10px;
        padding-right: 10px;
    }

    .container.body-content > h2 { font-size: 30px; }
    .BkgndContent { padding: 22px 18px 26px; border-radius: 14px; }
    .BkgndContent table th,
    .BkgndContent table td { padding: 10px 10px; }
}

/* Grid header tooltips (Pregmune2.js reads abbr/title on th hover) */
#tooltip {
    position: absolute;
    padding: 10px;
    width: 200px;
    background: black;
    color: white;
    border-radius: 5px;
    opacity: 0.3;
    z-index: 1000;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .Button,
    .BkgndContent input[type="submit"],
    .BkgndContent a,
    .InputBox,
    .DropDownList {
        transition: none;
    }
}
