/* Form css */
:root {
    --form-text-primary: #283618;
    --form-text-muted: #606c38;
}

body {
    font-family: var(--bcntb-font-sans, Inter, "Segoe UI", Roboto, Arial, sans-serif);
    font-size: 16px;
    line-height: 1.5;
    /* background-color: #f7f9fb; */
    margin: 0;
    padding: 2rem;
    color: var(--form-text-primary);
}

body.form-page {
    background: var(--bcntb-grey);
    padding: 0;
}

body.form-page.portal-login-page {
    background: var(--bcntb-text);
}

.form-shell {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px;
}

.form-card {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 32px;
}

.form-card--narrow {
    max-width: 420px;
}

.form-card--wide {
    max-width: 700px;
}

.form-title {
    margin: 0 0 8px;
    text-align: center;
    font-size: 1.5em;
    font-weight: 700;
}

.form-title--brand {
    color: var(--bcntb-pink);
}

.form-field {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--form-text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 16px;
    box-sizing: border-box;
    background: #fff;
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.form-input[disabled] {
    background: #f8fafc;
    color: var(--form-text-muted);
}

.form-input-icon {
    position: relative;
}

.form-input-icon .form-input {
    padding-right: 36px;
}

.form-input-icon .form-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--form-text-muted);
}

#togglePassword {
    top: 70%;
}

.form-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.form-links {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.form-link {
    color: var(--bcntb-pink);
    text-decoration: none;
}

.form-link:hover {
    color: var(--bcntb-pink);
    text-decoration: underline;
}

.form-muted {
    color: var(--form-text-muted);
    font-size: 14px;
}

.form-button {
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.form-button--primary {
    background: var(--bcntb-text);
    color: #fff;
}

.form-button--secondary {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #e6eef8;
}

/* .form-button--primary:hover {
    background: #0b3b5f;
} */

.form-section {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    color: #283618;
    font-size: 1.3rem;
    border-bottom: 2px solid #283618;
    padding-bottom: 0.3rem;
    /* margin-top: 0.5rem; */
}

.form-profile {
    margin-top: 12px;
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0 40px;
}

#profile-form .form-actions {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 16px;
}

#profile-form .form-actions .form-button {
    width: auto;
    min-width: 140px;
}

.form-container {
    max-width: 1200px;
    margin: auto;
    background: white;
    padding: 2rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.form-help-box {
    margin-bottom: 1.5rem;
    border-radius: 6px;
}

.form-help {
    margin: 0;
    color: var(--form-text-primary);
    line-height: 1.6;
}

.form-help a {
    color: #283618;
    text-decoration: none;
}

.form-help a:hover {
    text-decoration: underline;
}

.form-container h1 {
    text-align: center;
    color: #283618;
    margin-bottom: 1.5rem;
}

.form-container h2 {
    color: #283618;
    font-size: 1.3rem;
    border-bottom: 2px solid #283618;
    padding-bottom: 0.3rem;
    margin-top: 2rem;
}

label,
legend {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0.6rem 0 0.3rem;
    color: var(--form-text-primary);
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
}

textarea {
    resize: vertical;
}

.keywords input {
    display: block;
    margin-bottom: 0.4rem;
}

.form-keywords {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.form-keywords .form-input {
    flex: 1 1 140px;
    min-width: 120px;
}

.form-option-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 15px;
    color: var(--form-text-primary);
}

.scope-select-group {
    align-items: flex-start;
    flex-wrap: wrap;
}

.scope-select-item {
    flex: 1 1 280px;
    min-width: 240px;
}

/* Cohort Card */
.cohort-card {
    background: #fcfdfe; /* Even lighter shade */
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.cohort-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.cohort-header h3 {
    color: #283618;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.cohort-header label {
    font-size: 1.1rem;
    font-weight: 600;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem 1.5rem;
}

.filter-actions {
    margin-top: 1.5rem;
    text-align: right;
}

.filter-actions button {
    background-color: #283618;
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
}

.reset-btn {
    background-color: #98a8ca;
    color: var(--form-text-primary);
    margin-right: 0.8rem;
    border: none;
    padding: 0.3rem 0.6rem;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
}

.reset-btn:hover {
    background-color: #7a8fb5;
}

/* .filter-actions button:hover:not(.reset-btn) {
    background-color: #094a45;
} */

button.submit-btn {
    background-color: #283618;
    color: white;
    border: none;
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 1.5rem;
    display: block;
    width: auto;
}

/* Smooth hover darkening for all buttons */
.upload-btn,
.add-cohort-btn,
.reset-btn,
.submit-btn,
.addRowBtn,
.removeRowBtn,
.remove-cohort-btn {
    transition: filter 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

/* Darken visually on hover/focus without needing to know exact background color */
.upload-btn:hover,
.add-cohort-btn:hover,
.reset-btn:hover,
.submit-btn:hover,
.addRowBtn:hover,
.removeRowBtn:hover,
.remove-cohort-btn:hover,
.upload-btn:focus,
.add-cohort-btn:focus,
.reset-btn:focus,
.submit-btn:focus,
.addRowBtn:focus,
.removeRowBtn:focus,
.remove-cohort-btn:focus {
    filter: brightness(0.88);
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.file-upload-row {
    /* display: flex; */
    flex-direction: column;
    /* margin-top: 1rem; */
}

.file-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--form-text-primary);
    margin-bottom: 0.4rem;
}

.file-input-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: #fafbfc;
    padding: 0.6rem;
    border-radius: 8px;
}

.upload-btn {
    background-color: #283618;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.3s ease;
}

/* .upload-btn:hover {
    background-color: #094a45;
} */

.file-name {
    font-size: 0.95rem;
    color: var(--form-text-muted);
    font-style: italic;
    word-break: break-word;
}

.availability-indicator {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: 10px;
}

.availability-indicator .status {
    color: #22c55e;
}

.sampleTable select,
.sampleTable input {
    width: 100%;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    background-color: #fff;
}

.sampleTable th{
    padding:6px; 
    border:1px solid #ddd; 
    border-radius: 6px;
    background:#283618; 
    color:white; 
    font-size: 0.95em;
}

.advanced-filters {
    transition: all 0.3s ease;
}

.cohort-filters, .sample-selection, .filter-notes {
    background: #f7f9fc; /* Updated to a softer tone */
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.cohort-filters h4,
.sample-selection h4,
.filter-notes label {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.5rem;
    font-size:1rem; 
    font-weight:600;
    margin-top: 0;
    background-color: #e0e7f1; /* Updated to a more distinct shade */
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#cohortNotes{
    border: none;
}

.filter-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem 1.2rem;
    margin-bottom: 1.2rem;
    padding-left: 1.2rem;
    padding-right: 1.2rem;
}

.filter-item {
    min-height: 70px;
}

.filter-item select,
.filter-item textarea {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
    background-color: #fff;
}

.filter-item label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--form-text-primary);
    margin-bottom: 0.3rem;
    display: block;
}

.event-details-info {
    min-height: 18px;
    visibility: hidden;
}

.event-details-info.is-visible {
    visibility: visible;
}

.expand-filters {
    text-align: right;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    margin-right: 0.5rem;
}

.filter-notes {
    /* margin-top: 1.5rem; */
    grid-column: 1 / -1;
    /* span across all grid columns */
    width: 100%;
}

.hidden {
    display: none;
}

.toggle-btn {
    background: none;
    border: none;
    color: #283618;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

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

.add-cohort-btn, .addRowBtn {
    background-color: #283618;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.3s ease;
}

/* .add-cohort-btn:hover, .addRowBtn:hover {
    background-color: #094a45;
} */

.remove-cohort-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.2s ease;
    position: absolute;
    right: -15px;
    top: -10px;
}

.remove-cohort-btn:hover {
    color: #283618;
    text-decoration: underline;
}

.cohort-header {
    position: relative;
}

.cohort-header .availability-indicator {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Unified font size and family for interactive elements */
.upload-btn,
.add-cohort-btn,
.reset-btn,
.submit-btn,
.addRowBtn,
.removeRowBtn,
.remove-cohort-btn,
.toggle-btn {
    font-size: 0.95rem;
    font-family: inherit;
}

/* Tables: ensure consistent text sizing */
table th,
table td {
    font-size: 0.95rem;
    font-family: inherit;
}

.view-file-btn {
    color: var(--bcntb-purple);
    background-color: var(--bcntb-pink-100);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
    margin-top: 10px;
    margin-bottom: 20px;
}

.view-file-btn:hover {
    text-decoration: underline;
    color: var(--bcntb-purple);
}

.view-file-btn::after {
    content: url(../assets/svg/glossary-marker.aa28ced9.svg);
    color: var(--bcntb-purple);
    font-size: 0.85rem;
    margin-left: 6px;
}

/* Multi-select container styles */
.multi-select-container {
    width: 100%;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
    max-height: 200px;
    overflow-y: scroll;
    display: flex;
    flex-direction: column;
}

.multi-select-container::-webkit-scrollbar {
    width: 6px;
}

.multi-select-container::-webkit-scrollbar-track {
    background: transparent;
}

.multi-select-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.multi-select-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Firefox scrollbar styling */
.multi-select-container {
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.multi-select-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    margin: 0;
    border: none;
    background: white;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.multi-select-option:last-child {
    border-bottom: none;
}

.multi-select-option:hover {
    background-color: #f8f8f8;
}

.multi-select-option input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #283618;
}

.multi-select-option span {
    flex: 1;
    user-select: none;
}

@media (max-width:720px) {
    .form-container {
        padding: 1rem 0.9rem;
        border-radius: 0;
        box-shadow: none;
    }

    .form-profile {
        padding: 0 12px;
    }

    .form-option-group {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.5rem 1rem;
    }

    .scope-select-item {
        min-width: 0;
        flex: 1 1 100%;
    }

    .file-input-container,
    .cohort-header,
    .filter-actions {
        flex-wrap: wrap;
    }

    .cohort-header .availability-indicator {
        position: static;
        left: auto;
        top: auto;
        transform: none;
        width: 100%;
        text-align: left;
        margin-top: 0.5rem;
    }

    .filter-grid,
    .filter-section {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .filter-section {
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }

    .sample-selection-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sampleTable {
        min-width: 860px;
    }

    #sampleRequestForm > div:last-of-type {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
    }

    #sampleRequestForm > div:last-of-type > div {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    #saveContinueBtn,
    #cancelBtn,
    #submitBtn,
    #backBtn,
    #addCohortBtn {
        width: 100%;
        margin-top: 0;
    }

    #profile-form .form-actions {
        flex-wrap: wrap;
    }

    #profile-form .form-actions .form-button {
        width: 100%;
    }
}

/* Custom selectpicker styling */
.bootstrap-select .btn {
    background-color: white !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    color: var(--form-text-primary) !important;
}

.bootstrap-select .btn:hover,
.bootstrap-select .btn:focus,
.bootstrap-select .btn:active {
    background-color: white !important;
    border-color: #999 !important;
    box-shadow: none !important;
}

.bootstrap-select .dropdown-menu {
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bootstrap-select .dropdown-item:hover {
    background-color: #f8f9fa;
}

.bootstrap-select .dropdown-item.active,
.bootstrap-select .dropdown-item.selected {
    background-color: #283618 !important;
    color: white !important;
}

/* Remove Bootstrap black box focus outline */
button:focus,
input:focus,
select:focus,
textarea:focus,
.btn:focus,
.form-control:focus,
.bootstrap-select .btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

button:active,
.btn:active {
    outline: none !important;
    box-shadow: none !important;
}

/* Custom tooltip styling */
.custom-tooltip .tooltip-inner {
    max-width: 400px;
    text-align: left;
    padding: 10px;
    font-size: 15px;
    line-height: 1.6;
}

.custom-tooltip.reset-tooltip .tooltip-inner {
    width: auto;
    max-width: 85px;
    padding: 5px 8px;
    text-align: center;
    font-size: 12px;
}

.select-highlight .btn {
    background-color: #fff3cd !important; /* Light yellow for highlighting */
    border-color: #ffc107 !important;
}

.filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background-color: #99581e;
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-right: 8px;
}

/* Palette update: 606c38, 283618, fffaf1, dda15e, 99581e */
.form-card {
    background: #fffaf1;
    border: 1px solid #dda15e;
}

.form-title--brand,
.required,
.section-title,
.form-section-title {
    color: #99581e !important;
}

.form-input,
.form-textarea,
.form-select,
.form-control,
.bootstrap-select .dropdown-toggle {
    border-color: #dda15e !important;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus,
.form-control:focus,
.bootstrap-select .dropdown-toggle:focus {
    border-color: #99581e !important;
}

.btn,
button[type="submit"],
.portal-primary-action,
.send-email,
#submit_eoi {
    background-color: #99581e !important;
    border-color: #99581e !important;
    color: #fffaf1 !important;
}

.btn:hover,
button[type="submit"]:hover,
.portal-primary-action:hover,
.send-email:hover,
#submit_eoi:hover {
    background-color: #283618 !important;
    border-color: #283618 !important;
    /* color: #fffaf1 !important; */
}

.bootstrap-select .dropdown-item.active,
.bootstrap-select .dropdown-item.selected {
    background-color: #606c38 !important;
    color: #fffaf1 !important;
}

/* ── Auth pages mobile layout ──────────────────────────────────────── */
@media (max-width: 600px) {
    .form-shell {
        padding: 20px 10px;
        align-items: flex-start;
        min-height: 100dvh;
    }

    .form-card {
        padding: 20px 16px;
        border-radius: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .form-card--narrow,
    .form-card--wide {
        max-width: 100%;
    }

    .form-title {
        font-size: 1.2rem;
    }

    .form-title--brand {
        font-size: 1rem;
    }

    .form-section h3,
    .form-section h4 {
        font-size: 1rem;
    }

    .form-section p,
    .form-section li {
        font-size: 0.875rem;
    }

    .form-button,
    .form-submit-btn {
        padding: 10px 16px;
        font-size: 0.95rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* Info banners with inline display:flex — allow icon to wrap */
    .form-section > div[style*="display:flex"] {
        flex-wrap: wrap;
        gap: 6px !important;
    }

    /* Form field labels and inputs */
    .form-field label {
        font-size: 0.875rem;
    }

    .form-field input,
    .form-field select,
    .form-field textarea {
        font-size: 0.9rem;
    }

    /* Login-page specific: reset/forgot-password link */
    .portal-login-page .form-card .form-footer,
    .portal-login-page .form-card a {
        font-size: 0.85rem;
    }

    /* "Already have an account?" / "Don't have an account?" links */
    .form-links {
        font-size: 0.82rem;
        gap: 6px;
    }

    .form-links span,
    .form-links a.form-link {
        font-size: 0.82rem;
    }

    /* Login page: stack "Forgot password?" and "Don't have an account?" */
    .portal-login-page .form-links {
        flex-direction: column;
        align-items: center;
    }
}
