:root {
    --medx-navy: #071d4d;
    --medx-blue: #0f68dc;
    --medx-blue-dark: #0757bf;
    --medx-blue-soft: #eaf3ff;
    --medx-teal: #059a7c;
    --medx-green: #039766;
    --medx-green-bg: #dff7ef;
    --medx-orange: #f58505;
    --medx-orange-bg: #fff1df;
    --medx-purple: #7b3ff2;
    --medx-purple-bg: #f0e9ff;
    --medx-text: #101a37;
    --medx-muted: #53617d;
    --medx-border: #d9e2ee;
    --medx-border-strong: #cbd7e6;
    --medx-bg: #f8fbff;
    --medx-card: #ffffff;
    --medx-shadow: 0 14px 34px rgba(14, 34, 75, 0.055);
    --medx-shadow-small: 0 6px 18px rgba(14, 34, 75, 0.045);
    --font: "Open Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Helvetica Neue", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--medx-bg);
    color: var(--medx-text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.35;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.portal-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(15, 104, 220, .035), transparent 32rem),
        linear-gradient(180deg, #ffffff 0, #f9fbff 13rem, #f8fbff 100%);
}

.topbar {
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 39px 0 22px;
    border-bottom: 1px solid var(--medx-border);
    background: rgba(255, 255, 255, .96);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--medx-navy);
    font-weight: 800;
    font-size: 27px;
    letter-spacing: -.7px;
}

.brand-logo {
    height: auto;
    max-height: 58px;
    max-width: min(420px, 46vw);
    object-fit: contain;
    display: block;
}


.brand-mark {
    width: 43px;
    height: 43px;
    color: var(--medx-navy);
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.brand-mark svg {
    width: 100%;
    height: 100%;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 28px;
}

.secure-state {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--medx-green);
    font-weight: 700;
}

.secure-state svg {
    width: 21px;
    height: 21px;
}

.profile-menu {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    border: 0;
    background: transparent;
    color: var(--medx-text);
    cursor: pointer;
    padding: 0;
    font-weight: 700;
}

.avatar {
    width: 39px;
    height: 39px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: var(--medx-navy);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(7, 29, 77, .16);
}

.profile-name {
    font-size: 14px;
}

.chevron {
    width: 18px;
    height: 18px;
    color: #273858;
}

.portal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 74px);
    width: 100%;
}


.sidebar {
    background: #0b1528; /* Polished Dark Navy */
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px 16px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-link {
    position: relative;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-radius: 8px;
    color: #94a3b8; /* Muted slate text for off-selected state */
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -.08px;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.side-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.side-link-label {
    min-width: 0;
    flex: 1;
}

.side-link.active {
    background: var(--medx-blue);
    color: #ffffff;
}

.side-link-disabled {
    color: #64748b;
    opacity: 0.72;
    cursor: not-allowed;
}

.side-link-disabled:hover {
    color: #64748b;
    background: transparent;
}

.side-link-child {
    min-height: 40px;
    margin-left: 22px;
    padding-left: 14px;
    border-left: 1px solid rgba(148, 163, 184, 0.22);
    font-size: 13px;
}

.side-icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: currentColor;
}

.side-icon svg {
    width: 20px;
    height: 20px;
}

.side-icon-letter {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.side-link.active .side-icon-letter {
    background: rgba(255, 255, 255, 0.2);
}

.nav-status-pill {
    margin-left: auto;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.24);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    padding: 4px 6px;
    white-space: nowrap;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 20px;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569; /* Muted text for labels */
    padding: 0 16px;
    margin-bottom: 6px;
    display: block;
}

.side-button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* Reset for button mobile navigation links */
button.mobile-nav-link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

/* Mobile Sidebar Drawer Styles */
.mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 21, 40, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1100;
    animation: fadeIn 0.2s ease;
}

.mobile-sidebar-drawer {
    position: fixed;
    top: 0;
    bottom: 64px; /* Stop above mobile bottom nav */
    left: 0;
    width: 280px;
    background: #0b1528;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    animation: slideInLeft 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.close-drawer {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-drawer:hover {
    color: #ffffff;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.content-area {
    padding: 23px 38px 29px 38px;
    max-width: 1200px;
    width: 100%;
}


.page-heading {
    margin-bottom: 14px;
}

.page-heading h1 {
    margin: 0 0 4px 0;
    color: var(--medx-navy);
    font-size: 27px;
    line-height: 1.15;
    letter-spacing: -.55px;
    font-weight: 820;
}

.page-heading p {
    margin: 0;
    color: #213150;
    font-size: 15px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 13px;
}

.summary-card {
    min-height: 87px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
    border: 1px solid var(--medx-border);
    border-radius: 0;
    background: var(--medx-card);
    box-shadow: var(--medx-shadow-small);
}

.summary-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    flex: 0 0 auto;
}

.summary-icon svg {
    width: 30px;
    height: 30px;
}

.summary-icon.green {
    color: var(--medx-green);
    background: var(--medx-green-bg);
}

.summary-icon.blue {
    color: var(--medx-blue);
    background: var(--medx-blue-soft);
}

.summary-icon.orange {
    color: var(--medx-orange);
    background: var(--medx-orange-bg);
}

.summary-icon.purple {
    color: var(--medx-purple);
    background: var(--medx-purple-bg);
}

.summary-label {
    display: block;
    color: #1f2d4b;
    font-weight: 680;
    font-size: 13px;
    margin-bottom: 7px;
}

.summary-value {
    display: block;
    color: #121b35;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -.18px;
}

.summary-value.success {
    color: var(--medx-green);
}

.summary-value.warning {
    color: #ef7900;
}

/* Work grid layout using Bootstrap columns */
.work-grid {
    margin-bottom: 12px;
}

.card {
    border: 1px solid var(--medx-border);
    background: var(--medx-card);
    border-radius: 0;
    box-shadow: var(--medx-shadow);
}

.patient-card,
.upload-card {
    min-height: 336px;
    padding: 17px 18px 14px 18px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.card-title h2,
.consent-header h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
    color: var(--medx-navy);
    font-weight: 800;
    letter-spacing: -.1px;
}

.title-icon {
    width: 25px;
    height: 25px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.title-icon svg {
    width: 24px;
    height: 24px;
}

.blue-text {
    color: var(--medx-blue);
}

.form-grid {
    display: grid;
    gap: 13px;
}

.form-grid.two {
    grid-template-columns: 1fr 1fr;
    gap: 12px 22px;
}

.field {
    display: block;
    position: relative;
}

.field span {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #14203e;
    font-size: 12px;
    font-weight: 760;
    margin-bottom: 8px;
}

.field em {
    color: #e53935;
    font-style: normal;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--medx-border-strong);
    border-radius: 7px;
    background: #fff;
    color: #14203e;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(20, 35, 66, .015);
}

.field input,
.field select {
    height: 36px;
    padding: 0 11px;
}

.field textarea {
    min-height: 71px;
    resize: vertical;
    padding: 12px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--medx-blue);
    box-shadow: 0 0 0 3px rgba(15, 104, 220, .10);
}

.has-icon input {
    padding-right: 39px;
}

.has-icon > svg {
    position: absolute;
    right: 12px;
    bottom: 9px;
    width: 17px;
    height: 17px;
    color: #576680;
}

.info-dot {
    width: 17px;
    height: 17px;
    color: #53617d;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 21px;
    border-radius: 6px;
    padding: 2px 10px;
    line-height: 1;
    font-size: 12px;
    font-weight: 800;
    width: fit-content;
}

.green-pill {
    color: #03845a;
    background: #d9f3e8;
}

.orange-pill {
    color: #eb7100;
    background: #ffedd2;
}

.blue-pill {
    color: #0964d8;
    background: #dceaff;
}

.drop-zone {
    min-height: 158px;
    border: 2px dashed #2f85f8;
    border-radius: 0;
    background: #fbfdff;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 18px 20px;
    color: var(--medx-blue);
}

.drop-icon {
    width: 60px;
    height: 60px;
    margin-bottom: -2px;
}

.drop-zone p {
    margin: 0 0 8px 0;
    color: #101a37;
    font-size: 15px;
    font-weight: 650;
}

.drop-zone a,
.drop-zone-action {
    color: var(--medx-blue);
    font-weight: 800;
    text-decoration: none;
}

.file-type-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #44516c;
    font-size: 13px;
    margin: 1px 0 8px 0;
    flex-wrap: wrap;
}

.file-type-row b {
    background: #ccefe5;
    color: #04806c;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 12px;
    min-width: 39px;
}

.drop-zone small {
    color: #3d4c68;
    font-size: 13px;
}

.upload-form-row {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(220px, 1.2fr);
    gap: 20px;
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box;
}

.upload-form-row .form-group {
    min-width: 0;
}

.upload-form-row select,
.upload-form-row textarea {
    width: 100%;
    box-sizing: border-box;
}

.upload-form-row textarea {
    min-height: 72px;
    resize: vertical;
}

@media (max-width: 768px) {
    .upload-form-row {
        grid-template-columns: 1fr;
    }
}


.select-field select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #33425f 50%), linear-gradient(135deg, #33425f 50%, transparent 50%);
    background-position: calc(100% - 18px) 16px, calc(100% - 13px) 16px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    color: #53617d;
}

.document-card {
    padding: 11px 17px 9px 17px;
    margin-bottom: 12px;
}

.compact-title {
    margin-bottom: 9px;
    gap: 10px;
}

.solid-blue {
    color: var(--medx-blue);
}

.table-shell {
    overflow-x: auto;
    border: 1px solid var(--medx-border);
    border-radius: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
    background: #fff;
}

th,
td {
    text-align: left;
    border-bottom: 1px solid var(--medx-border);
    color: #14203e;
}

th {
    height: 30px;
    padding: 0 20px;
    background: #f7f9fc;
    font-size: 12px;
    font-weight: 800;
    color: #2c3852;
}

td {
    height: 35px;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 560;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    border-radius: 4px;
    color: #fff;
    font-size: 8px;
    font-weight: 900;
    margin-right: 11px;
    vertical-align: middle;
}

.file-icon.pdf {
    background: #ef382c;
}

.file-icon.img {
    background: #19a86f;
}

.actions {
    white-space: nowrap;
}

.actions button {
    width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    margin-right: 13px;
    border: 0;
    color: #263855;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
}

.actions button:hover {
    background: #edf4ff;
    color: var(--medx-blue);
}

.actions svg {
    width: 18px;
    height: 18px;
}

.consent-card {
    padding: 13px 20px 15px 20px;
}

.consent-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.shield-small {
    color: #254574;
}

.consent-line {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #16213c;
    font-size: 13px;
    margin-left: 1px;
}

.consent-line input {
    width: 17px;
    height: 17px;
    margin: 1px 0 0 0;
    accent-color: var(--medx-blue);
    flex: 0 0 auto;
}

.privacy-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 9px 0 0 31px;
    color: var(--medx-blue);
    font-weight: 800;
    text-decoration: none;
    font-size: 13px;
}

.privacy-link svg {
    width: 15px;
    height: 15px;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding: 0 0 40px 0;
}

.confirmation-area {
    display: flex;
    justify-content: center;
    padding-top: 72px;
}

.confirmation-card {
    width: min(100%, 680px);
    padding: 38px;
    text-align: center;
}

.confirmation-icon {
    width: 58px;
    height: 58px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 50%;
    background: var(--medx-green-bg);
    color: var(--medx-green);
}

.confirmation-icon svg {
    width: 32px;
    height: 32px;
}

.confirmation-heading {
    margin-bottom: 24px;
}

.confirmation-heading p {
    max-width: 540px;
    margin: 0 auto;
}

.confirmation-action {
    text-decoration: none;
}

.calendly-card {
    padding: 24px;
}

.calendly-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--medx-border);
}

.calendly-card-header h2,
.calendly-fallback h2 {
    margin: 0 0 6px 0;
    color: var(--medx-navy);
    font-size: 18px;
    font-weight: 800;
}

.calendly-card-header p,
.calendly-fallback p {
    margin: 0;
    color: var(--medx-muted);
}

.calendly-direct-link {
    margin: 0;
    white-space: nowrap;
}

.calendly-widget-container {
    width: 100%;
    min-width: 320px;
    height: 760px;
    border: 1px solid #f1f5f9;
    border-radius: 0;
    overflow: hidden;
    background: #f8fafc;
}

.calendly-widget-shell {
    position: relative;
    width: 100%;
}

.calendly-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    border: 1px solid #f1f5f9;
    border-radius: 0;
    background: #f8fafc;
    color: var(--medx-muted);
    font-weight: 700;
}

.calendly-loading-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #d8e7fb;
    border-top-color: var(--medx-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.calendly-fallback {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 72px 24px;
    text-align: center;
}

.calendly-fallback-action {
    text-decoration: none;
}

.submit-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(239, 246, 255, 0.92);
    backdrop-filter: blur(8px);
    animation: medexFadeIn .18s ease-out;
}

.submit-loading-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 28px;
    border: 1px solid #dbeafe;
    border-radius: 0;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
    text-align: center;
}

.blue-loading-circle {
    width: 72px;
    height: 72px;
    margin: 0 auto 22px;
    border: 6px solid #dbeafe;
    border-top-color: var(--medx-blue);
    border-radius: 999px;
    animation: medexSpin .9s linear infinite;
}

.submit-loading-card h2 {
    margin: 0 0 10px;
    color: var(--medx-navy);
    font-size: 22px;
    font-weight: 800;
}

.submit-loading-card p {
    margin: 0;
    color: #475569;
    font-size: 15px;
    line-height: 1.5;
}

.appointment-success-card {
    display: grid;
    justify-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding: 34px 28px;
    border: 1px solid var(--medx-border);
    border-radius: 0;
    background: var(--medx-card);
    box-shadow: var(--medx-shadow);
    text-align: center;
}

.appointment-success-icon {
    width: 58px;
    height: 58px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: var(--medx-green-bg);
    color: var(--medx-green);
    font-size: 28px;
    font-weight: 900;
}

.appointment-success-card h2 {
    margin: 0;
    color: var(--medx-navy);
    font-size: 24px;
    font-weight: 850;
}

.appointment-success-card p {
    max-width: 620px;
    margin: 0;
    color: var(--medx-muted);
    font-size: 15px;
    line-height: 1.55;
}

.appointment-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 6px;
}

.appointment-actions a {
    text-decoration: none;
}


.btn {
    min-width: 176px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    pointer-events: auto;
}

.btn svg {
    width: 19px;
    height: 19px;
}

.btn.outline {
    border: 1.5px solid var(--medx-blue);
    background: #fff;
    color: var(--medx-blue);
}

.btn.primary {
    min-width: 205px;
    border: 1.5px solid var(--medx-blue-dark);
    background: linear-gradient(180deg, var(--medx-blue), var(--medx-blue-dark));
    color: #fff;
    box-shadow: 0 8px 15px rgba(15, 104, 220, .22);
}

.btn:hover {
    transform: translateY(-1px);
}

@media (max-width: 1180px) {
    .content-area {
        padding-right: 22px;
        padding-left: 22px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-actions {
        margin-top: 12px;
        padding-right: 0;
    }
}

@media (max-width: 820px) {
    .topbar {
        padding: 0 16px;
    }

    .brand-lockup {
        font-size: 22px;
    }

    .brand-logo {
        max-height: 46px;
        max-width: min(260px, 62vw);
    }

    .secure-state span,
    .profile-name {
        display: none;
    }

    .summary-grid,
    .form-grid.two {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .confirmation-area {
        padding-top: 32px;
    }

    .confirmation-card {
        padding: 28px 20px;
    }

    .calendly-card {
        padding: 18px;
    }

    .calendly-card-header {
        flex-direction: column;
        gap: 12px;
    }

    .calendly-widget-container {
        min-width: 100%;
        height: 780px;
    }

    .calendly-direct-link {
        white-space: normal;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 767px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        font-size: 15px;
    }

    .portal-shell {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .topbar {
        min-height: 66px;
        height: auto;
        padding: 10px 16px;
        gap: 10px;
    }

    .brand-lockup {
        min-width: 0;
        flex: 1 1 auto;
    }

    .brand-logo {
        max-height: 42px;
        max-width: min(240px, 58vw);
    }

    .topbar-actions {
        flex: 0 0 auto;
        gap: 10px;
    }

    .secure-state {
        gap: 6px;
    }

    .secure-state svg {
        width: 20px;
        height: 20px;
    }

    .profile-menu {
        min-height: 44px;
    }

    .avatar {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .portal-body {
        min-height: calc(100vh - 66px);
        align-items: stretch;
    }

    .content-area {
        width: 100%;
        max-width: 100%;
        padding: 16px !important;
    }

    .page-heading {
        margin-bottom: 16px;
    }

    .page-heading h1 {
        font-size: 24px;
        line-height: 1.2;
        margin-bottom: 8px;
    }

    .page-heading p {
        font-size: 14px;
        line-height: 1.5;
    }

    .work-grid,
    .form-grid.two,
    .upload-form-row {
        grid-template-columns: 1fr;
        gap: 16px;
        width: 100%;
    }

    .card,
    .patient-card,
    .upload-card,
    .consent-card,
    .calendly-card,
    .confirmation-card {
        width: 100%;
        min-height: 0;
        padding: 18px;
        border-radius: 0;
        box-sizing: border-box;
    }

    .card-title,
    .consent-header {
        align-items: flex-start;
        gap: 10px;
    }

    .card-title h2,
    .consent-header h2 {
        font-size: 17px;
        line-height: 1.25;
    }

    .field,
    .form-group {
        width: 100%;
        min-width: 0;
    }

    .field span {
        font-size: 13px;
        line-height: 1.35;
    }

    .field input,
    .field select,
    .field textarea,
    .form-control {
        width: 100%;
        min-height: 48px;
        height: auto;
        font-size: 16px;
        border-radius: 8px;
        box-sizing: border-box;
    }

    .field input,
    .field select {
        padding: 0 12px;
    }

    .field textarea {
        min-height: 96px;
        padding: 12px;
    }

    .select-field select {
        background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
    }

    .drop-zone {
        width: 100%;
        min-height: 180px;
        padding: 24px 16px;
        gap: 8px;
        border-radius: 0;
    }

    .drop-icon {
        width: 58px;
        height: 58px;
    }

    .drop-zone p {
        font-size: 16px;
        line-height: 1.35;
        margin-bottom: 2px;
    }

    .drop-zone small {
        font-size: 13px;
        line-height: 1.45;
    }

    .file-type-row {
        gap: 8px;
        margin: 6px 0;
    }

    .file-type-row span {
        flex-basis: 100%;
        line-height: 1.35;
    }

    .selected-files-list {
        padding: 14px !important;
    }

    .selected-files-list li {
        align-items: flex-start !important;
        gap: 10px;
    }

    .selected-files-list li > div {
        min-width: 0;
        flex: 1 1 auto;
        flex-wrap: wrap;
        white-space: normal !important;
    }

    .selected-files-list li span {
        white-space: normal;
        word-break: break-word;
    }

    .consent-line {
        gap: 12px;
        font-size: 14px;
        line-height: 1.5;
    }

    .consent-line input {
        width: 22px;
        height: 22px;
        margin-top: 2px;
        min-width: 22px;
        min-height: 22px;
    }

    .privacy-link {
        margin-left: 34px;
        line-height: 1.4;
    }

    .form-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        width: 100%;
        margin-top: 24px;
        padding-bottom: 24px;
    }

    .btn,
    .form-actions button,
    .calendly-fallback-action,
    .confirmation-action,
    .appointment-actions a,
    .appointment-actions button {
        width: 100%;
        min-height: 52px;
        justify-content: center;
        text-align: center;
        font-size: 16px;
    }

    .calendly-card-header {
        flex-direction: column;
        gap: 12px;
    }

    .calendly-card-header h2,
    .calendly-fallback h2 {
        font-size: 18px;
        line-height: 1.25;
    }

    .calendly-card-header p,
    .calendly-fallback p {
        font-size: 14px;
        line-height: 1.5;
    }

    .calendly-direct-link {
        margin: 0;
        width: 100%;
        justify-content: center;
        text-align: center;
        min-height: 44px;
        padding: 11px 14px;
        border: 1px solid var(--medx-blue);
        border-radius: 8px;
        background: #fff;
    }

    .calendly-widget-shell,
    .calendly-inline-widget,
    .calendly-widget-container {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
        height: 780px;
        border-radius: 0;
        overflow: hidden;
        box-sizing: border-box;
    }

    .calendly-loading {
        border-radius: 0;
    }

    .calendly-fallback {
        padding: 52px 18px;
    }

    .submit-loading-overlay {
        padding: 18px;
    }

    .submit-loading-card {
        max-width: 100%;
        padding: 32px 22px;
        border-radius: 0;
    }

    .blue-loading-circle {
        width: 64px;
        height: 64px;
    }

    .submit-loading-card h2 {
        font-size: 20px;
    }

    .submit-loading-card p {
        font-size: 14px;
    }

    .appointment-success-card {
        padding: 28px 20px;
        border-radius: 0;
    }

    .appointment-success-card h2 {
        font-size: 22px;
    }

    .appointment-success-card p {
        font-size: 14px;
    }

    .appointment-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .confirmation-area {
        padding-top: 28px;
    }

    .confirmation-heading p {
        font-size: 14px;
        line-height: 1.5;
    }

    .content-area > article.card {
        padding: 18px !important;
        border-radius: 0 !important;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 9px 12px;
    }

    .brand-logo {
        max-height: 38px;
        max-width: min(210px, 56vw);
    }

    .topbar-actions {
        gap: 8px;
    }

    .avatar {
        width: 34px;
        height: 34px;
    }

    .content-area {
        padding: 12px !important;
    }

    .page-heading h1 {
        font-size: 22px;
    }

    .card,
    .patient-card,
    .upload-card,
    .consent-card,
    .calendly-card,
    .confirmation-card {
        padding: 16px;
        border-radius: 0;
    }

    .drop-zone {
        min-height: 170px;
        padding: 22px 14px;
    }

    .drop-icon {
        width: 52px;
        height: 52px;
    }

    .consent-line {
        font-size: 13px;
    }

    .privacy-link {
        margin-left: 0;
        margin-top: 12px;
    }

    .calendly-widget-shell,
    .calendly-inline-widget,
    .calendly-widget-container {
        height: 800px;
    }

    .calendly-fallback {
        padding: 44px 14px;
    }

    .submit-loading-card {
        padding: 30px 20px;
        border-radius: 0;
    }

    .appointment-success-card {
        padding: 24px 16px;
    }

    .content-area > article.card {
        padding: 16px !important;
    }
}

@keyframes medexFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes medexSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Claimant Portal Layout Additions */
@media (min-width: 768px) {
    .portal-body {
        display: flex;
        flex-direction: row;
        align-items: stretch;
    }
    .sidebar {
        flex: 0 0 260px;
        width: 260px;
        min-height: calc(100vh - 74px);
        display: flex;
        flex-direction: column;
    }
    .content-area {
        flex: 1;
        width: auto;
    }
    .d-none-desktop {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .d-none-mobile {
        display: none !important;
    }
    .portal-body {
        padding-bottom: 78px; /* Offset for the fixed mobile bottom nav */
    }
}

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--medx-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: safe-area-inset-bottom;
    box-shadow: 0 -4px 16px rgba(14, 34, 75, 0.05);
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--medx-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    flex: 1;
    height: 100%;
}

.mobile-nav-link svg {
    width: 20px;
    height: 20px;
    color: currentColor;
}

.mobile-nav-link.active {
    color: var(--medx-blue);
}

.mobile-nav-link.active svg {
    color: var(--medx-blue);
}

/* Sidebar Footer & Logout Styles */
.sidebar-footer {
    margin-top: auto;
    padding: 24px 20px 0 25px; /* Alignment consistent with side links */
}

.logout-button {
    width: 100%;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1.5px solid var(--medx-border);
    background: #ffffff;
    color: #1a2c4c;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.logout-button:hover {
    background: #fef2f2; /* Subtle red alert background on hover */
    border-color: #fca5a5;
    color: #b42318;
}

.logout-button svg {
    color: currentColor;
}

.mobile-logout-button {
    background: transparent;
    border: 0;
    padding: 8px;
    cursor: pointer;
    color: var(--medx-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 160ms ease;
    margin-left: 8px;
}

.mobile-logout-button:hover {
    color: #b42318;
}

.profile-email {
    font-size: 14px;
    font-weight: 700;
    color: var(--medx-text);
}

/* Symmetrical Alignment overrides */
.content-area {
    padding: 0 !important;
    max-width: none !important;
}

.portal-page-shell {
    width: 100%;
    box-sizing: border-box;
    padding: 32px 24px;
}

.portal-page-container {
    width: 100%;
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .portal-page-shell {
        padding: 20px 16px;
    }
    .portal-page-container {
        max-width: 100%;
    }
}

/* Fixed App Shell & Scroll Containment Layout */
html,
body {
    height: 100%;
    overflow: hidden;
}

.portal-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.topbar {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 74px;
}

.portal-body {
    display: flex;
    flex: 1;
    height: calc(100vh - 74px) !important;
    width: 100%;
    overflow: hidden !important;
}

@media (min-width: 768px) {
    .portal-body {
        flex-direction: row;
        align-items: stretch;
    }
    
    .sidebar {
        flex: 0 0 260px;
        width: 260px;
        height: 100% !important;
        overflow-y: auto !important;
        flex-shrink: 0;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }
    
    .content-area {
        flex: 1;
        height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        min-width: 0;
    }
}

@media (max-width: 767px) {
    .portal-body {
        flex-direction: column;
        height: calc(100vh - 66px) !important; /* Mobile topbar height is 66px */
    }
    
    .content-area {
        flex: 1;
        height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        min-width: 0;
        padding-bottom: 80px !important; /* Extra padding for mobile bottom nav bar */
    }
}

/* Shared Spacing for Document Viewers */
.document-resource-viewer {
    margin-top: 36px !important;
}

@media (max-width: 768px) {
    .document-resource-viewer {
        margin-top: 28px !important;
    }
}

@media (max-width: 480px) {
    .document-resource-viewer {
        margin-top: 20px !important;
    }
}

/* ---------------------------------------------------- */
/* Claimant Portal Refined Sidebar Styles               */
/* Enhances layout structure and text hierarchy         */
/* ---------------------------------------------------- */

/* Wrapper layout class applied to claimant portal navigation sidebar */
.claimant-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header title displayed at the top of the claimant sidebar */
.claimant-sidebar-header {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    padding: 0 12px 16px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Individual group section container holding specific navigation nodes */
.claimant-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

/* Category section header label used to group sidebar items visually */
.claimant-sidebar-section-title {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 12px;
    margin-top: 12px;
    margin-bottom: 6px;
    display: block;
}

/* Base navigation hyperlink node inside claimant portal sidebar */
.claimant-sidebar-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 10px 12px;
    min-height: 40px;
    border-radius: 6px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

/* Hover style state for claimant sidebar links */
.claimant-sidebar-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
}

/* Active current route highlighting style for claimant sidebar links */
.claimant-sidebar-link.active {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-left: 3px solid #3b82f6;
    padding-left: 9px; /* Adjusted padding offset for border-left */
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Muted disabled state for uncompleted navigation nodes in claimant sidebar */
.claimant-sidebar-link.disabled {
    color: #475569;
    cursor: not-allowed;
    background: transparent;
}

/* Muted hover prevention for disabled claimant sidebar items */
.claimant-sidebar-link.disabled:hover {
    color: #475569;
    background: transparent;
}

/* Informative pill-badge showing status (e.g. Pending, Coming Soon) under labels */
.claimant-sidebar-badge {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
    margin-top: 4px;
    white-space: normal;
    word-break: break-word;
}

/* Text label holding the primary item text in claimant sidebar */
.claimant-sidebar-label {
    display: block;
}

/* Dedicated styling configuration for claimant logout button */
.claimant-sidebar-signout {
    font-family: inherit;
    font-size: 14px;
}

/* Hover effect specifically for claimant logout button */
.claimant-sidebar-signout:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}
