/* === site-modern.css (MERGED) === */
/* Global modern theme for ASCIP Abstract Management System */

/* ---------------- Colors & Theme ---------------- */
:root {
    --brand: #3a6f8f; /* ASCIP Blue */
    --brand-600: #305a74; /* Darker hover shade */
    --err: #dc2626;
    --ok: #16a34a;
    --warn: #eab308;
    --text: #1e293b;
    --muted: #475569;
    --bg: #f9fafb;
    --card: #ffffff;
    --line: #d1d5db;
}

/* ASCIP brand text */
.brand-text {
    color: var(--brand) !important;
}

/* ---------------- Base & Typography ---------------- */
html, body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
}

h1, h2, h3 {
    color: var(--text);
    margin-top: 0;
    font-weight: 700;
}

/* ---------------- Layout Helpers ---------------- */
.mod-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.mod-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 6px 24px rgba(2, 6, 23, 0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

    .mod-card.hoverable {
        transition: box-shadow .2s, transform .2s, border-color .2s;
    }

        .mod-card.hoverable:hover {
            box-shadow: 0 10px 32px rgba(2,6,23,.09);
            border-color: var(--brand);
            transform: translateY(-1px);
        }

/* Responsive grid helper */
.mod-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 900px) {
    .mod-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------------- Field Groups ---------------- */
.mod-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.3rem;
}

.mod-label {
    font-weight: 600;
    color: var(--text);
    position: relative;
}

    .mod-label[data-required="true"]::after {
        content: " *";
        color: var(--err);
        font-weight: 700;
    }

.mod-help {
    color: var(--muted);
    font-size: 0.85rem;
}

/* ---------------- Inputs & Textareas ---------------- */
.mod-input,
.mod-select,
.mod-textarea {
    border: 1px solid var(--line);
    border-radius: 0.6rem;
    padding: 0.55rem 0.75rem;
    font-size: 1rem;
    width: 22rem; /* fixed but reasonable width for normal rows */

    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .mod-input:focus,
    .mod-select:focus,
    .mod-textarea:focus {
        border-color: var(--brand);
        outline: none;
        box-shadow: 0 0 0 3px rgba(58, 111, 143, 0.25);
    }

.mod-textarea {
    min-height: 120px;
}

/* ---------------- Buttons ---------------- */
.btn {
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    border-radius: 0.75rem;
    padding: 0.45rem 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

    .btn:hover {
        background: var(--brand-600);
        border-color: var(--brand-600);
    }

    .btn.ghost {
        background: transparent;
        color: var(--brand);
        border-color: var(--brand);
    }

        .btn.ghost:hover {
            background: var(--brand);
            color: #fff;
        }

    .btn.danger {
        background: var(--err);
        border-color: var(--err);
    }

    .btn.wide {
        padding: 0.45rem 1.4rem;
        min-width: 9rem;
    }

/* ---------------- Validation ---------------- */
.validator {
    color: var(--err);
    font-size: 0.9rem;
}

.validation-summary {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #7f1d1d;
    padding: 0.75rem;
    border-radius: 0.75rem;
    margin: 0.5rem 0;
}

/* ---------------- Tables ---------------- */
.mod-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    overflow: hidden;
}

    .mod-table th, .mod-table td {
        padding: 0.65rem 0.75rem;
        border-bottom: 1px solid var(--line);
    }

    .mod-table th {
        background: #f1f5f9;
        text-align: left;
        font-weight: 600;
    }

    .mod-table tr:last-child td {
        border-bottom: none;
    }

/* ---------------- Links ---------------- */
a {
    color: var(--brand);
    text-decoration: none;
}

    a:hover {
        color: var(--brand-600);
        text-decoration: underline;
    }

/* ---------------- Checkbox Alignment (ASP.NET) ---------------- */
.mod-field.checkbox-field {
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
}

    .mod-field.checkbox-field span {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
    }

    .mod-field.checkbox-field input[type="checkbox"] {
        margin: 0;
    }

    .mod-field.checkbox-field label {
        margin: 0;
        line-height: 1.2;
    }

.mod-field input[type="checkbox"] {
    vertical-align: middle;
}

/* ---------------- Login-Specific Enhancements (kept from your file) ---------------- */
.login-hero {
    text-align: center !important;
}

    .login-hero .brand {
        font-weight: 800;
        letter-spacing: .2px;
        margin: 0;
    }

    .login-hero .sub {
        margin: .35rem 0 0 0;
    }

.muted-link a {
    color: var(--brand);
    text-decoration: none;
}

    .muted-link a:hover {
        text-decoration: underline;
    }

.divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: .75rem 0 0;
}

    .divider::before, .divider::after {
        content: "";
        height: 1px;
        background: var(--line);
        flex: 1;
    }

.caps-hint {
    display: none;
    color: var(--warn);
    font-size: .85rem;
    margin-top: .2rem;
}

    .caps-hint.on {
        display: block;
    }

.field-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: .35rem;
}

.pw-toggle {
    background: none;
    border: 0;
    cursor: pointer;
    font-size: .9rem;
    padding: 0;
    color: var(--brand);
}

    .pw-toggle:hover {
        text-decoration: underline;
    }

/* Force light site background everywhere (overrides legacy styles) */
html, body, form, #inside, #contentwrapper {
    background: var(--bg) !important;
}

.mod-card {
    background: var(--card);
}

/* ===================================================================== */
/*      ProfileEdit – Alignment (labels/inputs) – CONSOLIDATED RULES     */
/* ===================================================================== */

/* If you still have any old ".mod-form-table" usage, keep it consistent */
.mod-form-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    width: 100%;
}

    .mod-form-table tr > td:first-child {
        width: 220px;
        text-align: right;
        padding-right: 12px;
        white-space: nowrap;
        vertical-align: middle;
        line-height: 1.2;
        color: var(--text);
    }

    .mod-form-table tr > td:last-child {
        vertical-align: middle;
    }

    .mod-form-table input[type="text"],
    .mod-form-table input[type="email"],
    .mod-form-table input[type="tel"],
    .mod-form-table input[type="number"],
    .mod-form-table select,
    .mod-form-table textarea {
        margin: 0;
        line-height: 1.25;
        height: 2.4rem;
        padding: 0.5rem 0.75rem;
    }

    .mod-form-table textarea {
        height: auto;
        min-height: 120px;
    }

    .mod-form-table .mod-label {
        display: inline-block;
        margin: 0 12px 0 0;
        vertical-align: middle;
    }

    .mod-form-table .validator {
        margin-top: 4px;
        display: inline-block;
    }

/* Primary table used on this page */
.profile-form {
    text-align: left; /* ensure right column starts left-aligned */
    border-collapse: separate;
    border-spacing: 0 3px; /* tightened vertical rhythm between rows */
    width: 100%;
}

    .profile-form td {
        vertical-align: middle; /* center labels vs inputs */
        padding: 2px 8px; /* consistent breathing room */
    }

    .profile-form .mod-label {
        display: inline-block;
        white-space: nowrap;
        min-width: 220px;
        text-align: right; /* label right-align in left column */
        margin-right: 12px;
    }

    .profile-form .mod-input {
        height: 32px;
        line-height: 30px;
        padding: 3px px;
        width: auto;
        max-width: 420px;
        box-sizing: border-box;
    }

    .profile-form .validator {
        display: inline-block;
        margin-left: 8px;
        vertical-align: middle;
        white-space: nowrap;
        line-height: 1;
    }

/* ===================================================================== */
/*          Conflict of Interest – Overflow & Inline Rows Fix            */
/* ===================================================================== */
.coi-section {
    max-width: 100%;
    overflow: hidden;
}

    .coi-section .coi-table {
        width: 100%;
        table-layout: fixed;
        border-collapse: separate;
        border-spacing: 0 8px;
    }

        .coi-section .coi-table th, .coi-section .coi-table td {
            word-break: break-word;
            overflow-wrap: anywhere;
        }

.inline-fields {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto 1fr;
    gap: 8px 12px;
    align-items: center;
    margin: 6px 0;
}

.field-label {
    white-space: nowrap;
}

.coi-section .mod-input, .coi-section select, .coi-section textarea {
    width: 100%;
    max-width: 100%;
    height: 36px;
    box-sizing: border-box;
}

.coi-section textarea {
    min-height: 100px;
    resize: vertical;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .inline-fields {
        grid-template-columns: 1fr;
    }

        .inline-fields .field-label {
            text-align: left;
        }
}

/* ===================================================================== */
/*                   LEGACY BLOCKS BROUGHT BACK (alerts, menu, CV)       */
/* ===================================================================== */

/* --- Widen Save Abstract button text (keep) --- */
.btn.wide {
    padding: 0.45rem 1.4rem;
    min-width: 9rem;
}
/* (dup safe) */

/* === Modern menu polish (Telerik RadMenu) === */
#navmenu .topnav .rmRootGroup {
    display: inline-flex;
    gap: .25rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 9999px;
    padding: .35rem;
    box-shadow: 0 6px 24px rgba(2, 6, 23, 0.05);
}

    #navmenu .topnav .rmRootGroup > .rmItem > .rmLink {
        border-radius: 9999px;
        padding: .45rem .90rem;
        line-height: 1;
        color: var(--text);
        text-decoration: none;
    }

        #navmenu .topnav .rmRootGroup > .rmItem > .rmLink:hover,
        #navmenu .topnav .rmRootGroup > .rmItem.rmFocused > .rmLink,
        #navmenu .topnav .rmRootGroup > .rmItem.rmSelected > .rmLink {
            background: var(--brand);
            color: #fff;
        }

#navmenu .topnav .rmGroup {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: .75rem;
    padding: .35rem;
    box-shadow: 0 10px 32px rgba(2, 6, 23, 0.12);
}

    #navmenu .topnav .rmGroup .rmItem > .rmLink {
        border-radius: .5rem;
        padding: .45rem .75rem;
        color: var(--text);
    }

        #navmenu .topnav .rmGroup .rmItem > .rmLink:hover,
        #navmenu .topnav .rmGroup .rmItem.rmFocused > .rmLink,
        #navmenu .topnav .rmGroup .rmItem.rmSelected > .rmLink {
            background: var(--brand);
            color: #fff;
        }

#navmenu .topnav .rmRootGroup .rmSeparator {
    display: none;
}

#navmenu .level1 {
    background: transparent !important;
    height: auto !important;
    border-right: 0 !important;
    padding: 0 !important;
}
/* Center container and menu */
#navmenu {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.25rem auto 0.1rem auto;
    text-align: center;
    width: 100%;
}

    #navmenu .RadMenu.topnav, #navmenu .topnav.RadMenu {
        display: inline-flex;
        justify-content: center;
    }

    #navmenu .topnav .rmRootGroup {
        justify-content: center;
        margin: 0 auto;
    }

/* === CV Upload component === */
.cv-upload-card {
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
    padding: 1.25rem;
    background: #f8fafc;
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: box-shadow 0.2s, border-color 0.2s;
}

    .cv-upload-card:hover {
        box-shadow: 0 8px 24px rgba(2,6,23,0.06);
        border-color: #94a3b8;
    }

.cv-upload-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    background: #fff;
    display: grid;
    place-items: center;
    border: 1px solid #e2e8f0;
}

.cv-upload-body {
    flex: 1 1 auto;
}

.cv-upload-title {
    font-weight: 700;
    margin: 0 0 0.25rem 0;
}

.cv-upload-hint {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.cv-upload-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.cv-btn {
    appearance: none;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    border-radius: 0.75rem;
    padding: 0.5rem 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .cv-btn.secondary {
        background: transparent;
        color: var(--brand);
    }

.cv-file-name {
    margin-top: 0.5rem;
    color: #334155;
    font-size: 0.9rem;
    display: none;
}

.cv-has-file .cv-file-name {
    display: block;
}

.cv-hidden-input {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    width: 1px;
    height: 1px;
}

/* === Alerts (info/success/warning/danger) === */
.alert {

    position: relative;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-family: Arial, sans-serif;
}

.alert-info {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.alert-warning {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffecb5;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.alert strong {
    font-weight: 600;
}

.alert-info.bold {
    font-weight: 600;
}

/* === Utilities === */
.container--fluid {
    max-width: none !important;
}

/* ===== Profile form – safe centering for 2-column rows only ===== */
/* Target by table id to guarantee we hit the right markup */
#tblProfile.profile-form {
    border-collapse: separate;
    border-spacing: 0 3px; /* tighten row spacing */
}
.profile-form tr > td[colspan] .mod-label,
.profile-form tr > td[colspan="2"] .mod-label {
    min-width: 0;
    margin-right: 0;
    text-align: left;
    white-space: normal;
    display: block;
}
    /* Vertically center both label and field cells */
    #tblProfile.profile-form tr > td {
        vertical-align: middle;
    }

        /* Keep labels right-aligned in the first column (original look) */
        #tblProfile.profile-form tr > td:first-child .mod-label {
            display: inline-block;
            white-space: nowrap;
            line-height: 1.00;
            text-align: left;
            min-width: 200px; /* matches your earlier widths */
            margin-right: 10px;
        }

        /* Make the input + validator sit on one line and align vertically */
        #tblProfile.profile-form tr > td:nth-child(2) {
            white-space: nowrap; /* keeps * and input on one line */
        }
        #tblProfile.profile-form tr > td[colspan] .mod-label {
            min-width: 0;
            margin-right: 0;
            text-align: left; /* or keep right if you prefer – left usually looks better here */
            display: block; /* makes it behave like a normal block label */
        }
    /* Inputs: consistent height to stabilize the row's visual center */
    #tblProfile.profile-form .mod-input {
        height: 36px;
        line-height: 36px;
        padding: 2px 6px;
        box-sizing: border-box;
        vertical-align: middle;
    }

    /* Validators: inline and centered; do not stretch the row */
    #tblProfile.profile-form .validator {
        display: inline-block;
        vertical-align: middle;
        margin-left: 8px;
        line-height: 1;
        white-space: nowrap;
    }

    /* Do NOT interfere with full-width rows (colspan=2) — keep them normal */
    /* Do NOT interfere with full-width rows (colspan=2) — keep them normal */
    #tblProfile.profile-form tr > td[colspan] {
        white-space: normal; /* allow wrapping in info/COI sections */
    }

    /* Optional: tiny spacing consistency for the “small-print” help text */
    #tblProfile.profile-form .mod-help {
        line-height: 1.00;
    }

/* -------- Abstract section wrapping & overflow control -------- */
.abstract-section {
    /* Keep your chosen width constraint here if desired */
    /* max-width: 900px; margin: 0 auto; */
}

    .abstract-section, .abstract-section * {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

        .abstract-section .abstract-table {
            table-layout: fixed;
        }

            .abstract-section .abstract-table td:nth-child(2) {
                width: auto;
                max-width: 100%;
            }

        /* Long anchors/URLs */
        .abstract-section a {
            word-break: break-all;
        }

        .abstract-section .mod-textarea {
            display: block;
            width: min(100%, 85ch);
            min-height: 6.5rem;
            line-height: 1.35;
            padding: 8px 10px;
            box-sizing: border-box;
        }

        .abstract-section .mod-textarea--wide {
            width: min(100%, 100ch);
        }

        /* ==== Abstract textareas exact width fixes (scoped & safe) ==== */
        .abstract-section .abstract-table {
            table-layout: fixed;
            width: 100%;
        }

            .abstract-section .abstract-table td:first-child {
                width: 200px;
                vertical-align: top;
                white-space: nowrap;
                padding-top: 6px;
            }

            .abstract-section .abstract-table td:nth-child(2) {
                max-width: 100%;
            }

/* Wider multiline inputs for specific controls inside Abstract section */

table .mod-textarea {
    box-sizing: border-box;
}
/* safety */

/* optional very-large screens bump */
@media (min-width: 1280px) {
    .abstract-section
    .abstract-section, .abstract-section * {
        overflow-wrap: anywhere;
        word-break: break-word;
    }


    /* === Scoped fluid rules ONLY inside Abstract section === */
    .abstract-section .abstract-table {
        table-layout: fixed;
        width: 100%;
    }

        .abstract-section .abstract-table td:first-child {
            width: clamp(140px, 22vw, 220px);
            vertical-align: top;
            white-space: nowrap;
            padding-top: 6px;
        }

        .abstract-section .abstract-table td:nth-child(2) {
            width: auto;
            max-width: 100%;
        }

    /* Only multiline textareas inside the Abstract area are fluid */
    .abstract-section textarea {
        width: 100%;
        max-width: none;
        display: block;
        box-sizing: border-box;
    }

    /* Keep long words/URLs from blowing out the layout */
    .abstract-section, .abstract-section * {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

        .abstract-section a {
            word-break: break-all;
        }

    /* Optional: stack label/field on small screens for this section only */
    @media (max-width: 700px) {
        .abstract-section .abstract-table,
        .abstract-section .abstract-table tr,
        .abstract-section .abstract-table td {
            display: block;
            width: 100%;
        }

            .abstract-section .abstract-table td:first-child {
                margin-bottom: .25rem;
            }
        /* Fluid container with centered, responsive bounds */
        .container--fluid {
            width: 100%;
        }

            .container--fluid > .content-bounds {
                /* Soft cap that grows/shrinks with viewport */
                max-width: clamp(700px, 95vw, 1200px);
                margin: 0 auto;
                padding-inline: 1rem; /* keeps edges off the screen */
            }

            /* Make common offenders obey the bounds in this page */
            .container--fluid .content-bounds .mod-card,
            .container--fluid .content-bounds .abstract-section,
            .container--fluid .content-bounds table {
                width: 100%;
                max-width: 100%;
                box-sizing: border-box;
            }

            /* Tables: be truly fluid, and wrap instead of forcing the page wider */
            .container--fluid .content-bounds table {
                table-layout: fixed;
                border-collapse: separate;
            }

            .container--fluid .content-bounds td:first-child {
                /* label column scales down a bit on smaller screens */
                width: clamp(140px, 22vw, 220px);
                vertical-align: top;
                white-space: nowrap;
            }

            /* Inputs in this page: follow the column, don’t exceed it */
            .container--fluid .content-bounds .mod-input,
            .container--fluid .content-bounds .mod-select,
            .container--fluid .content-bounds .mod-textarea {
                width: 100%;
                max-width: 100%;
                box-sizing: border-box;
            }

            /* Multiline: comfortable height without forcing global tall boxes */
            .container--fluid .content-bounds .mod-textarea {
                min-height: 6.5rem;
            }

            /* Prevent long words/URLs from blowing out the layout */
            .container--fluid .content-bounds,
            .container--fluid .content-bounds * {
                overflow-wrap: anywhere;
                word-break: break-word;
            }

                .container--fluid .content-bounds a {
                    word-break: break-all;
                }
    }
}


/* Simple horizontal button row for actions like Add/Edit */
.btn-row {
    display: inline-flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}