:root {
    --bs-primary: #000078;
}
html, body {
    width: 100%;
    overflow-x: hidden;
}
body {
    background-color: #ffffff;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    line-height: 1.625;
}

.text-primary {
    color: var(--bs-primary) !important;
}

.bg-primary {
    background-color: var(--bs-primary) !important;
}

.btn-primary {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.btn-primary:hover {
    background-color: #0000a0 !important;
    border-color: #0000a0 !important;
}

.color-nav {
    background-color: white !important;
}

.color-link {
    color: #000078 !important;
}

.nav-underline {
    position: relative;
    text-decoration: none;
    color: #000078 !important;
}

.nav-underline::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background-color: #000078;
    transform: scaleX(0);
    transition: transform 0.3s ease-in-out;
}

.nav-underline:hover::after {
    transform: scaleX(1);
}

.nav-underline-lang {
    color: #000078 !important;
}

.nav-underline-lang::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 0.5px;
    background-color: #000078;
    transform: scaleX(0);
    transition: transform 0.3s ease-in-out;
}

.nav-link.color-link {
    display: flex;
    align-items: center;
}

.nav-link.color-link img {
    width: 20px;
    height: 20px;
    margin-right: 5px;
}

.nav-underline-lang:hover::after {
    transform: scaleX(1);
}

.nav-item .nav-link.nav-underline.color-link:not(a) {
    text-decoration: none !important;
    border: 3px solid #000078;
    border-radius: 10px;
    padding: 6px 12px !important;
    margin: 0 5px;
    display: inline-block;
    font-size: small;
}

.nav-item .nav-link.nav-underline.color-link:not(a)::after {
    display: none;
}

.navbar-nav {
    margin-top: 15px;
}

.dropdown-menu a {
    color: #000078 !important;
}

.dropdown-menu a:hover {
    background-color: #f0f0f0;
}

.caret img {
    width: 17px;
    height: auto;
    display: inline-block;
    position: relative;
    transform: rotate(90deg);
}

/* Active language in dropdown */
.dropdown-menu a.lang-active {
    color: #ffffff !important;
    background-color: #000078 !important;
    border-radius: 4px;
}

/* Language selector button — fixed size so it doesn't shrink when logged in */
#languageSelector {
    min-width: 3rem;
    text-align: center;
}

/* Logout button — hide label by default, show on hover */
/* .nav-logout .logout-label {
    display: none;
    font-size: 0.875rem;
    font-weight: 600;
    color: #000078;
    white-space: nowrap;
} */

.nav-logout:hover .logout-label {
    display: inline;
}

/* Project page — page title and card titles at 26px */
.project-page-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: #000078;
    margin-bottom: 1.5rem;
}

.project-card-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: #000078;
}

/* =============================================
   GENERAL HOME STYLES
   ============================================= */

.text-custom {
    color: #000078;
}

.text-container {
    width: 25%;
    padding-left: 1.5rem;
    z-index: 10;
    text-align: left;
}

.header-text {
    position: absolute;
    top: 50%;
    left: 3%;
    transform: translateY(-50%);
    width: 60%;
}

.display-4 {
    font-size: 2.625rem;
    font-weight: 700;
    word-wrap: break-word;
    max-width: 100%;
}

.display-4 strong {
    font-weight: 800;
}

.lead {
    font-size: 1.125rem;
    font-weight: 300;
    max-width: 80%;
    margin-bottom: 1rem;
    line-height: 1.625;
}

.lead strong {
    font-weight: 500;
}

.header-image-container {
    height: 90vh;
    position: relative;
    overflow: hidden;
    margin-top: 60px;
}

.header-image {
    width: 110%;
    height: 160%;
    object-fit: cover;
    object-position: center;
    transform: translateX(-5%) translateY(-15%);
}

.header-button {
    display: inline-block;
    background-color: #000078;
    color: white !important;
    font-size: 1rem;
    font-weight: 800;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    text-decoration: none;
    margin-top: 1rem;
    transition: color 0.3s ease;
}

.header-button:hover {
    color: #71edff !important;
}

/* =============================================
   RESEARCH BUTTONS
   ============================================= */

.button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 2rem 5%;
    background: linear-gradient(135deg, #e8e7f5 0%, #f5f5ff 40%, #e4fbff 100%);
    margin: 2rem 0;
    border-radius: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 120, 0.10);
    width: 100%;
    box-sizing: border-box;
}

.button-container button {
    appearance: none;
    border: 1px solid rgba(0, 0, 120, 0.15);
    cursor: pointer;
    padding: 0.65rem 1.8rem;
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.60);
    color: #000078;
    backdrop-filter: blur(4px);
    font-family: 'Open Sans', sans-serif;
    font-size: clamp(0.8rem, 1.5vw, 1.05rem);
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    text-align: center;
}

.button-container button:hover {
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 120, 0.12);
}

.button-container button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* =============================================
   RESEARCH SECTION
   ============================================= */

.section-research {
    margin-top: 60px;
    margin-bottom: 40px;
}

.infoResearch {
    color: #000078;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    max-width: 55%;
    margin: 0 auto 2rem;
}

.image-container {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin: 2rem 0;
}

.image-card {
    position: relative;
    width: 29%;
    height: 600px;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1rem;
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(89, 95, 100, 0.73);
    color: #fff;
    padding: 1rem;
    border-radius: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.image-overlay h4 {
    font-size: 1.625rem;
    font-weight: 700;
    margin-bottom: 1.8rem;
}

.image-overlay p {
    font-size: 1rem;
    margin-top: 1rem;
}

/* =============================================
   TECH METHODOLOGIES SECTION
   ============================================= */

.techMetosection {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    padding: 0;
    background: linear-gradient(135deg, #e8e7f5 0%, #f5f5ff 40%, #e4fbff 100%);
    border-radius: 0;
    overflow: hidden;
    margin: 2rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 120, 0.10);
    width: 100%;
    box-sizing: border-box;
}

/* IMAGE — 1/3 width */
.techMetocontainer {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    display: flex;
    min-width: 0;
    padding: 0;
}

.techMetoimage {
    width: 100%;
    height: 100%;
    min-height: 400px;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    display: block;
}

/* TEXT SIDE — 2/3 width */
.techMetocontainer.techMetoside {
    flex: 0 0 66.666%;
    max-width: 66.666%;
    display: flex;
    align-items: center;
    padding: clamp(2rem, 5vw, 4rem) clamp(2rem, 5vw, 5rem);
    background: transparent;
}

.techMetotitle-container {
    width: 100%;
}

.techMetotitle-container .section-title {
    font-size: 1.625rem;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    text-align: left;
    border-bottom: 3px solid rgba(0, 0, 120, 0.15);
    letter-spacing: -0.02em;
}

.techMetolist {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 2rem;
    align-items: start;
}

.techMetolist li {
    font-size: 1rem;
    font-weight: 500;
    color: #000078;
    padding: 0.55rem 0.75rem 0.55rem 2.2rem;
    position: relative;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 0.5rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 120, 0.08);
    transition: background 0.2s ease, transform 0.2s ease;
    align-self: start;
}

.techMetolist li:hover {
    background: rgba(255, 255, 255, 0.85);
    transform: translateX(4px);
}

.techMetolist li::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #000078;
    opacity: 0.7;
}

/* =============================================
   OUR TEAM SECTION
   ============================================= */

.ourTeamSection {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding: 3rem 5%;
    background: linear-gradient(to left, #9d99d3 20%, #fff 60%, #e4fbff 90%);
}

.ourTeamContainer {
    flex: 1;
    display: flex;
    justify-content: center;
    width: 100%;
}

.ourTeamImage {
    width: 100%;
    max-width: 560px;
    height: auto;
    max-height: min(60vh, 480px);
    object-fit: cover;
    object-position: center;
    display: block;
}

.ourTeamSide {
    flex: 1;
    text-align: left;
    display: block;
    padding-right: 2rem;
}

.ourTeamTitle {
    color: #000078;
    font-size: 1.625rem;
    font-weight: 700;
    margin: 0;
    padding-bottom: 1rem;
}

.ourTeamText {
    font-size: 1rem;
    font-weight: 500;
    color: #000078;
    margin-bottom: 1.5rem;
}

/* Vertical layout only for the dedicated Our Team page */
.ourTeamSection.ourTeamPage {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2rem;
}

.ourTeamSection.ourTeamPage .ourTeamContainer {
    flex: 0 1 auto;
    width: 100%;
    max-width: 700px;
}

.ourTeamCard {
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 120, 0.12);
    display: inline-block;
    line-height: 0;
}

.ourTeamSection.ourTeamPage .ourTeamSide {
    flex: 0 1 auto;
    text-align: center;
    padding-right: 0;
}

/* =============================================
   NEWS SECTION
   ============================================= */

.news-section {
    background-color: #f8f9fa;
    padding: 60px 0;
    border-top: none;
}

.news-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
}

.news-img-container {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 8px;
}

.news-img-container img.news-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-content {
    flex-grow: 1;
}

.news-title {
    color: #000078 !important;
    font-weight: 700 !important;
    font-size: 4rem;
    margin: 1.5rem 0;
    text-align: left;
}

.news-column-scroll {
    scrollbar-width: thin;
    scrollbar-color: #aaa transparent;
    padding-right: 8px;
}

.news-column-scroll::-webkit-scrollbar {
    width: 8px;
}

.news-column-scroll::-webkit-scrollbar-thumb {
    background-color: #aaa;
    border-radius: 4px;
}

.news-section .row {
    max-height: 400px;
}

.news-section .col-md-9,
.news-section .col-md-3 {
    max-height: 100%;
}

.news-section h3 {
    all: unset;
}

.news-container {
    border: none;
    margin: 0;
    padding: 0;
}

.news-container a {
    text-decoration: none;
    color: #000078;
}

.news-container a:hover {
    text-decoration: none;
}

/* =============================================
   SECTION TITLES
   ============================================= */

.section-title {
    color: #000078 !important;
    font-weight: 700 !important;
    font-size: 1.625rem;
    margin: 1.5rem 0;
    text-align: left;
}

.section-title::after {
    content: none;
}

/* Centred title for research section */
.section-research .section-title {
    text-align: center;
    padding-left: 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1300px) {
    .display-4 {
        font-size: 2.2rem;
    }
}

@media (max-width: 1200px) {
    .display-4 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .lead {
        font-size: 1.125rem;
        margin-bottom: 1.5rem;
    }

    .header-button {
        font-size: 1rem;
        padding: 0.5rem 1.5rem;
    }

    .image-card {
        width: 45%;
        height: 500px;
    }

    .ourTeamImage {
        max-height: min(65vh, 500px);
    }
}

@media (max-width: 992px) {
    .display-4 {
        font-size: 1.875rem;
    }

    .lead {
        font-size: 1.125rem;
        max-width: 90%;
    }

    .ourTeamSide,
    .ourTeamContainer {
        padding: 1rem;
    }
}

@media (max-width: 910px) {
    .header-text {
        top: 40%;
    }

    .display-4 {
        font-size: 1.75rem;
    }

    .lead {
        font-size: 1rem;
    }

    .header-button {
        font-size: 0.9rem;
    }
}

@media (max-width: 900px) {
    /* techMeto stacks vertically */
    .techMetosection {
        flex-direction: column;
        border-radius: 1rem;
        margin: 1.5rem 2%;
    }

    .techMetocontainer,
    .techMetocontainer.techMetoside {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .techMetoimage {
        min-height: 260px;
        max-height: 340px;
    }

    .techMetolist {
        grid-template-columns: 1fr;
    }

    .techMetotitle-container .section-title {
        text-align: center;
    }

    .techMetolist li:hover {
        transform: none;
    }
}

@media (max-width: 768px) {
    .header-image-container {
        height: 60vh;
    }

    .header-text {
        top: 40%;
        transform: translateY(-40%);
    }

    .display-4 {
        font-size: 1.625rem;
        margin-bottom: 0.8rem;
    }

    .lead {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .header-button {
        font-size: 0.9rem;
        padding: 0.4rem 1.2rem;
        margin-top: 1rem;
    }

    .image-container {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .image-card {
        width: 90%;
        height: 300px;
    }

    .ourTeamSection {
        flex-direction: column;
        gap: 1.5rem;
    }

    .ourTeamContainer {
        width: 100%;
        order: 1;
    }

    .ourTeamSide {
        width: 100%;
        order: 2;
        text-align: center;
        padding-left: 0;
        padding-right: 0;
    }

    .ourTeamTitle {
        font-size: 1.625rem;
        padding-left: 0;
    }

    .ourTeamImage {
        width: 100%;
        height: auto;
        max-width: 100%;
    }

    .ourTeamText {
        font-size: 0.875rem;
    }

    .infoResearch {
        font-size: 0.875rem;
    }

    .image-overlay p {
        font-size: 0.875rem;
    }

    .techMetolist li {
        font-size: 0.875rem;
    }

    .button-container {
        gap: 0.75rem;
    }

    .button-container button {
        flex: 0 1 auto;
        width: auto;
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header-image-container {
        height: 50vh;
    }

    .header-text {
        top: 30%;
        transform: translateY(-30%);
    }

    .display-4 {
        font-size: 1.25rem;
        margin-bottom: 0.3rem;
    }

    .lead {
        font-size: 0.875rem;
        margin-bottom: 0.3rem;
    }

    .header-button {
        font-size: 0.8rem;
        padding: 0.3rem 1rem !important;
        margin-top: 0.8rem;
    }

    .image-card {
        height: 300px;
    }

    .ourTeamImage {
        max-height: min(50vh, 300px);
    }

    .ourTeamTitle {
        font-size: 1.625rem;
    }

    .ourTeamText {
        font-size: 0.875rem;
    }

    .text-container {
        width: 90%;
        padding-left: 1rem;
    }

    .techMetocontainer.techMetoside {
        padding: 1.5rem 1.2rem;
    }
}

@media (min-width: 1921px) {
    .display-4 {
        font-size: 3rem;
    }

    .lead {
        font-size: 1.25rem;
    }
}

/* =============================================
   ACCORDION OVERRIDES (Lab & Research pages)
   ============================================= */

.accordion {
    background-color: transparent !important;
}

.accordion-item {
    background-color: transparent !important;
    border: none !important;
    border-radius: 10px !important;
    margin-bottom: 1rem;
    margin-top: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.accordion-button {
    background-color: #000078;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    border-radius: 10px !important;
    border: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.accordion-button:not(.collapsed) {
    background-color: #000078 !important;
    color: white !important;
    border-radius: 10px !important;
}

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

.accordion-button::after {
    font-size: 1.5rem;
    color: #73EDFF;
    transition: transform 0.3s ease;
}

.accordion-body {
    color: #000078;
    font-size: 1rem;
    line-height: 1.625;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 1rem 1.5rem;
}

.accordion-collapse {
    border: none !important;
    box-shadow: none !important;
}

/* =============================================
   PAGE: LAB (ABOUT)
   ============================================= */

.page-lab .header-text,
.page-research .header-text {
    position: absolute;
    top: 58%;
    left: 3%;
    transform: translateY(-50%);
}

.page-lab .display-4,
.page-research .display-4 {
    font-size: 2.625rem;
    font-weight: 800;
    word-wrap: break-word;
    max-width: 100%;
}

.page-lab .lead,
.page-research .lead {
    font-size: 1.125rem;
    font-weight: 300;
    max-width: 100%;
    margin-bottom: 1rem;
    line-height: 1.625;
}

.page-lab .header-image-container,
.page-research .header-image-container {
    position: relative;
    width: 100%;
    height: 90vh;
    overflow: hidden;
    margin-top: 20px;
}

.page-lab .text-container {
    width: 35%;
    padding-left: 1.5rem;
    z-index: 10;
    text-align: left;
}

.page-lab .header-image {
    width: 120%;
    height: 120%;
    object-fit: cover;
    object-position: 5% 0%;
    transform: translateY(-5%);
}

.page-lab .header-button {
    display: inline-block;
    background-color: #000078;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    text-decoration: none;
    margin-top: 1rem;
    transition: color 0.3s ease;
}

.page-lab .header-button:hover {
    color: #71edff;
}

.cognitive-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4rem 5%;
    background: linear-gradient(to right, #e4fbff, #fdfdfd, #ecebf6);
}

.cognitive-section .left-content { width: 45%; }
.cognitive-section .right-content { width: 50%; text-align: center; }

.cognitive-image {
    width: 110%;
    height: 90%;
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cognitive-title,
.imaging-title,
.dataAnalysis-title,
.ia-title,
.neuromodulation-title {
    color: #000078;
    font-size: 1.625rem;
    font-weight: 700;
    text-align: left;
    margin: 1.5rem 0;
}

.cognitive-paragraph,
.imaging-paragraph,
.dataAnalysis-paragraph,
.ia-paragraph,
.neuromodulation-paragraph {
    text-align: left;
    margin: 1.5rem 0;
    color: #000078;
    font-size: 1rem;
    line-height: 1.625;
}

.imaging-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4rem 5%;
}

.imaging-section .right-content { width: 45%; }

.imaging-section .left-content {
    width: 45%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-top: 2rem;
}

.imaging-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dataAnalysis-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4rem 5%;
    background: linear-gradient(to right, #e4fbff, #fdfdfd, #ecebf6);
}

.dataAnalysis-section .left-content { width: 45%; }

.dataAnalysis-section .right-content {
    width: 50%;
    text-align: center;
    overflow: hidden;
    position: relative;
    border-radius: 10px;
}

.dataAnalysis-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: left top;
    transform: scale(2.5);
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ia-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3rem 4%;
}

.ia-section .right-content { width: 45%; }

.ia-section .left-content {
    width: 45%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-top: 2rem;
}

.ia-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-10%);
}

.neuromodulation-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4rem 5%;
    background: linear-gradient(to right, #e4fbff, #fdfdfd, #ecebf6);
}

.neuromodulation-section .left-content { width: 45%; text-align: left; }
.neuromodulation-section .right-content { width: 50%; text-align: left; }

.neuromodulation-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    top: -140px;
}

.neuroAccordion-section {
    padding: 2rem 0;
    background-color: transparent !important;
}

/* Lab responsive */
@media (max-width: 1366px) {
    .page-lab .display-4,
    .page-research .display-4 { font-size: 2.2rem; }
    .page-lab .header-button { font-size: 0.9rem; padding: 0.5rem 1rem; }
}

@media (max-width: 1280px) {
    .page-lab .display-4,
    .page-research .display-4 { font-size: 2rem; }
    .page-lab .header-button { font-size: 0.8rem; padding: 0.5rem 0.8rem; }
}

@media (max-width: 736px) {
    .page-lab .display-4 { font-size: 1.75rem; }
    .page-lab .lead { font-size: 1rem; }

    .cognitive-title,
    .imaging-title,
    .dataAnalysis-title,
    .ia-title,
    .neuromodulation-title { font-size: 1.4rem; }

    .cognitive-paragraph,
    .imaging-paragraph,
    .dataAnalysis-paragraph,
    .ia-paragraph,
    .neuromodulation-paragraph,
    .accordion-body { font-size: 0.875rem; }

    .page-lab .header-button { font-size: 0.7rem; padding: 0.5rem 0.8rem; }

    .cognitive-section,
    .imaging-section,
    .dataAnalysis-section,
    .ia-section,
    .neuromodulation-section { flex-direction: column; padding: 2rem 5%; }

    .cognitive-section .left-content,
    .imaging-section .right-content,
    .dataAnalysis-section .left-content,
    .ia-section .right-content,
    .neuromodulation-section .left-content { width: 100%; text-align: center; }

    .cognitive-section .right-content,
    .imaging-section .left-content,
    .dataAnalysis-section .right-content,
    .ia-section .left-content,
    .neuromodulation-section .right-content { width: 100%; margin-top: 1rem; }

    .neuromodulation-image { top: 0; }
}

@media (max-width: 420px) {
    .page-lab .display-4 { font-size: 1.5rem; }
    .page-lab .lead { font-size: 0.875rem; }

    .cognitive-title,
    .imaging-title,
    .dataAnalysis-title,
    .ia-title,
    .neuromodulation-title { font-size: 1.25rem; }

    .cognitive-paragraph,
    .imaging-paragraph,
    .dataAnalysis-paragraph,
    .ia-paragraph,
    .neuromodulation-paragraph { font-size: 0.875rem; }

    .page-lab .header-button { font-size: 0.6rem; padding: 0.5rem 0.8rem; }
}

@media (max-width: 360px) {
    .page-lab .display-4 { font-size: 1.25rem; }
    .page-lab .lead { font-size: 0.8rem; }

    .cognitive-title,
    .imaging-title,
    .dataAnalysis-title,
    .ia-title,
    .neuromodulation-title { font-size: 1.125rem; }

    .cognitive-paragraph,
    .imaging-paragraph,
    .dataAnalysis-paragraph,
    .ia-paragraph,
    .neuromodulation-paragraph { font-size: 0.8rem; }
}

/* =============================================
   PAGE: RESEARCH
   ============================================= */

.page-research .text-container {
    width: 45%;
    padding-left: 1.5rem;
    z-index: 10;
    text-align: left;
}

.page-research .header-image {
    width: 210%;
    height: 185%;
    object-fit: cover;
    object-position: center;
    transform: translateX(-20%) translateY(-15%);
}

.page-research .display-4 {
    color: #fff;
    max-width: 70%;
}

.page-research .lead {
    color: #fff;
    max-width: 160%;
}

.page-research .button-container {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
    height: 130px;
    background: linear-gradient(to right, #d9d9ee 30%, white 50%, #e3fbff 70%);
    border-bottom: 2px solid #000078;
    padding: 0 40px;
    gap: 20px;
    box-sizing: border-box;
    margin: 0;
    border-radius: 0;
}

.page-research .button-container button {
    flex: 1 1 0;
    max-width: 400px;
    background: transparent;
    border: 2px solid #000078;
    color: #000078;
    font-size: clamp(0.75rem, 1.3vw, 1.125rem);
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.625;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-research .button-container button:hover {
    transform: scale(1.05);
    background: transparent;
}

.section-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    min-height: 80vh;
    margin-top: 5%;
    margin-bottom: 5%;
    padding: 2rem 0;
}

.page-research .image-container {
    width: 45%;
    height: 700px;
    overflow: hidden;
    border-radius: 15px;
    position: relative;
    margin: 20px;
}

.page-research .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.content-container {
    width: 55%;
    padding: 2rem;
    text-align: left;
}

.content-container h2 {
    font-size: 1.625rem;
    font-weight: 700;
    color: #000078;
    margin-bottom: 1rem;
}

.content-container .small-text {
    font-size: 1.125rem;
    font-weight: 700;
    margin-top: -10px;
    color: #000078;
    margin-bottom: 1rem;
}

.content-container p {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.625;
    margin-top: 1rem;
    color: #000078;
    margin-bottom: 1.5rem;
}

.imaging-accordion-item {
    background-color: transparent !important;
    border-radius: 10px !important;
    margin-bottom: 1rem;
    margin-top: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.imaging-accordion-button {
    background-color: #000078;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    border-radius: 10px !important;
    border: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.imaging-accordion-button:not(.collapsed) {
    background-color: #000078 !important;
    color: white !important;
    border-radius: 10px !important;
}

.imaging-accordion-button.collapsed { border-radius: 10px !important; }

.imaging-accordion-button:focus,
.imaging-accordion-button:active {
    box-shadow: none !important;
    outline: none !important;
}

.imaging-accordion-button::after {
    font-size: 1.5rem;
    color: #73EDFF;
    transition: transform 0.3s ease;
}

.imaging-accordion-body {
    color: #000078;
    font-size: 1rem;
    line-height: 1.625;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 1rem 1.5rem;
}

/* Research responsive */
@media (max-width: 1366px) {
    .page-research .image-container { height: 600px; }
}

@media (max-width: 1280px) {
    .page-research .image-container { height: 550px; }
}

@media (max-width: 768px) {
    .section-container {
        flex-direction: column;
        height: auto;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 1rem;
    }

    .page-research .image-container,
    .content-container { width: 90%; margin: 10px auto; }

    .page-research .image-container { height: 450px; }

    .page-research .button-container {
        height: auto;
        flex-direction: column;
        gap: 10px;
        padding: 1rem 5%;
    }

    .page-research .button-container button {
        width: 80%;
        flex: 0 0 auto;
        height: auto;
        font-size: 0.875rem;
        padding: 8px 20px;
    }
}

@media (max-width: 640px) {
    .page-research .header-image-container { height: 60vh; }
    .page-research .header-image { width: 100%; height: 100%; transform: none; }
    .page-research .header-text { top: 50%; left: 5%; transform: translateY(-50%); text-align: left; width: 90%; }
    .page-research .display-4 { font-size: 1.75rem; max-width: 100%; }
    .page-research .lead { font-size: 1rem; max-width: 100%; }
    .page-research .button-container { height: auto; flex-direction: column; gap: 10px; padding: 15px 5%; }
    .page-research .button-container button { width: 80%; font-size: 0.875rem; padding: 8px 20px; }
    .page-research .image-container { height: 400px; }
}

@media (max-width: 420px) {
    .page-research .display-4 { font-size: 1.5rem; }
    .page-research .lead { font-size: 0.875rem; }
    .content-container h2 { font-size: 1.25rem; }
    .content-container p { font-size: 0.875rem; }
    .content-container .small-text { font-size: 1rem; }
    .imaging-accordion-body { font-size: 0.875rem; }
    .page-research .button-container button { width: 90%; font-size: 0.7rem; }
    .page-research .image-container { height: 350px; }
}

@media (max-width: 360px) {
    .page-research .display-4 { font-size: 1.25rem; }
    .page-research .lead { font-size: 0.8rem; }
    .content-container h2 { font-size: 1.125rem; }
    .content-container p { font-size: 0.8rem; }
    .content-container .small-text { font-size: 0.9rem; }
    .imaging-accordion-body { font-size: 0.8rem; }
    .page-research .button-container button { width: 90%; }
}
/* =============================================
   PAGE: HELPS
   ============================================= */

.header-image-containerHelps {
    position: relative;
    width: 100%;
    height: 85vh;
    overflow: hidden;
    margin-top: 20px;
}

.header-imageHelps {
    width: 150%;
    height: 160%;
    object-fit: cover;
    object-position: 15% 0%;
    transform: translateY(-25%);
}

.button-containerHelps {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 40px;
    z-index: 10;
}

.header-buttonHelps {
    background-color: #000078;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 0.5rem;
    text-decoration: none;
    text-align: center;
    transition: color 0.3s ease;
}

.header-buttonHelps:hover {
    color: #71edff;
    background-color: #000078;
}

/* =============================================
   LOGIN / FORM PAGES
   ============================================= */

.login-title {
    font-size: 1.625rem;
    font-weight: 600;
}

.login-input {
    font-size: 1rem;
    padding-right: 55px !important;
}

.info-text {
    font-size: 1rem;
    line-height: 1.625;
}

.login-button {
    font-size: 1rem;
    background-color: #000078 !important;
    border-color: #000078 !important;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
}

.login-button:hover {
    background-color: #2a2a9a !important;
    border-color: #2a2a9a !important;
}

.form-container {
    width: 100%;
    max-width: 520px; /* was 440px */
}

.login_inputs {
    min-height: 100vh;
}

.login-form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

#login-section .form-container,
#register-section .form-container,
#forgot-section .form-container,
#reset-section .form-container {
    width: min(100%, 520px);
}

#login-section .login-form-section form,
#register-section .login-form-section form {
    width: 100%;
    margin: 0 auto;
    max-width: 520px;
}

/* forgot and reset: full-width col, so center the form itself */
#forgot-section .login-form-section form,
#reset-section #resetForm {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

#register-section .login-form-section {
    order: 2;
}

#register-section .info-section {
    order: 1;
}

.login_inputs .form-container.pt-5 {
    padding-top: 1.5rem !important;
}


#reset-section #resetForm .row > .col-md-10 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
}

#togglePassword,
.toggle-password {
    z-index: 10;
    cursor: pointer !important;
    padding: 5px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#togglePassword:hover,
.toggle-password:hover {
    background-color: rgba(0, 0, 120, 0.05);
    transform: scale(1.15);
}

#togglePassword:active,
.toggle-password:active {
    transform: scale(0.95);
}

/* =============================================
   PAGE: PROJECT (project selection cards)
   ============================================= */

.contenedor-6 {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    padding-top: 2em;
}

#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.page-project .container-lg {
    position: relative;
    z-index: 1;
}

.page-project h1,
.page-project h2,
.page-project h3,
.page-project h4,
.page-project h5,
.page-project h6 {
    font-weight: bold;
    color: #000078;
}

.page-project .card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border: 10px solid #000078;
    width: 450px;
    height: 550px;
    margin: 0 auto;
    padding: 1.5em;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9);
}

.page-project .card h1 {
    font-size: 1.625rem;
    color: #000078;
    font-weight: 900;
    margin: 0.3em 0;
}

.page-project .card-text {
    font-weight: normal;
    margin: 0.1em 0;
}

.page-project .card-img {
    width: 60%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.page-project .card-body {
    text-align: center;
    width: 100%;
}

.page-project .btn-primary {
    background-color: #000078;
    border-color: #000078;
    font-size: 1rem;
    margin-top: 0.1em;
    padding: 0.5em 1.5em;
}

.page-project .card a {
    text-decoration: none;
    color: inherit;
}

.page-project .row {
    margin-bottom: 3em;
}

.project-status-text {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
    .page-project .card {
        width: 90%;
        height: auto;
        padding: 1em;
    }
}

/* =============================================
   PAGE: EXPLICACIO PROJ (standalone)
   ============================================= */

.page-explicacio {
    font-family: Arial, sans-serif;
    line-height: 1.625;
    color: #000078;
}

.page-explicacio .hero-section {
    background-color: #000078;
    color: white;
    padding: 2rem 0 3rem;
    text-align: center;
    position: relative;
}

.page-explicacio .hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-explicacio .hero-section h1 {
    font-size: 1.625rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.page-explicacio .hero-content .lead {
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

.participate-btn {
    position: absolute;
    left: 50%;
    bottom: -35px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #71edff;
    color: #000078;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%) rotate(-15deg);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    font-weight: bold;
}

.page-explicacio .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section-div {
    background-color: #d3d3d3;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.enhanced-image-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    margin: 3rem auto;
}

.enhanced-image-column {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.enhanced-image-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    height: 100%;
}

.enhanced-main-image {
    width: 100%;
    max-width: 320px;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    border: 6px solid #0d6efd;
    border-radius: 10px;
    margin-bottom: 20px;
}

.enhanced-head-image {
    width: 280%;
    height: 170px;
    object-fit: contain;
}

.enhanced-description {
    font-size: 1rem;
    color: #555;
    text-align: center;
    width: 100%;
    padding: 10px;
    font-weight: bold;
    margin-top: 10px;
}

.guide-images {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin: 3rem 0;
}

.interactive-image-container {
    position: relative;
    width: 320px;
}

.guide-image {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border: 4px solid #0d6efd;
    border-radius: 10px;
}

.anatomy-label {
    position: absolute;
    background-color: rgba(113, 237, 255, 0.9);
    color: #000078;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.line-arrow {
    position: absolute;
    background-color: #000078;
    height: 2px;
}

.arrow-right .line-arrow { width: 40px; right: -35px; transform: rotate(-20deg); }
.arrow-left .line-arrow  { width: 40px; left: -35px; transform: rotate(20deg); }
.arrow-up .line-arrow    { width: 40px; top: -25px; left: 50%; transform: translateX(-50%) rotate(90deg); }
.arrow-down .line-arrow  { width: 40px; bottom: -25px; left: 50%; transform: translateX(-50%) rotate(90deg); }

.custom-card {
    max-width: 260px;
    margin: 0 auto;
    transition: transform 0.3s;
    background: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.custom-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-img-container {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: white;
}

.page-explicacio .card-img-top {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.page-explicacio .card-body {
    padding: 1rem;
    background: white;
    text-align: center;
}

.btn-sm-custom {
    padding: 0.4rem 1.2rem;
    font-size: 0.875rem;
    background-color: #000078;
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.btn-sm-custom:hover {
    background-color: #00005a;
    transform: scale(1.05);
    color: white;
}

@media (max-width: 768px) {
    .page-explicacio .hero-section h1 { font-size: 1.4rem; }

    .participate-btn {
        right: 50%;
        transform: translateX(50%) rotate(-15deg);
        bottom: -30px;
        width: 70px;
        height: 70px;
        font-size: 0.875rem;
    }

    .enhanced-image-grid { flex-direction: column; align-items: center; gap: 40px; }
    .enhanced-image-column { width: 100%; max-width: 340px; }
    .enhanced-main-image { max-width: 300px; }
    .enhanced-head-image { max-width: 180px; }
    .guide-images { flex-direction: column; align-items: center; gap: 30px; }
    .interactive-image-container { width: 280px; }
    .guide-image { height: 280px; }
    .custom-card { max-width: 220px; margin-bottom: 1.5rem; }
    .card-img-container { height: 110px; }
}

@media (min-width: 1200px) {
    .enhanced-main-image { max-width: 360px; }
    .enhanced-head-image { max-width: 220px; }
}

/* =============================================
   FOOTER
   ============================================= */

.footer {
    background-color: #000078;
    padding: 40px 0;
    color: white;
    width: 100%;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 30px;
}

.footer-logos {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 200px;
}

.footer-logos .logo1 { width: 120px; height: auto; }
.footer-logos .logo2 { width: 150px; height: auto; }

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
    max-width: 400px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
}

.footer-legal {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    flex-wrap: wrap;
}

.footer-legal a {
    color: white;
    text-decoration: none;
}

@media (max-width: 992px) {
    .footer-container { flex-direction: column; align-items: center; text-align: center; gap: 30px; }
    .footer-logos { flex-direction: row; justify-content: center; align-items: center; gap: 40px; padding-left: 0; }
    .footer-links { text-align: center; padding-left: 0; }
    .footer-legal { justify-content: center; margin-right: 0; margin-bottom: 0; }
}

@media (max-width: 768px) {
    .footer { padding: 30px 0; }
    .footer-logos { flex-direction: column; gap: 20px; }
    .footer-logos .logo1 { width: 100px; }
    .footer-logos .logo2 { width: 130px; }
    .footer-links a { font-size: 0.875rem; }
}

@media (max-width: 480px) {
    .footer { padding: 25px 0; }
    .footer-container { gap: 20px; padding: 0 15px; }
    .footer-links { gap: 8px; }
    .footer-legal { font-size: 0.6875rem; gap: 5px; }
}

/* =============================================
   CAPTCHA & COORDINATES EXERCISES
   ============================================= */

/* Shared captcha container */
.captcha {
    margin: 20px auto;
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* captcha3x3: max-width 720px, 3-col grid */
.captcha.captcha-3x3 { max-width: 720px; }
/* captcha4x4: max-width 960px, 4-col grid */
.captcha.captcha-4x4 { max-width: 960px; }

.captcha-grid {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.captcha-3x3 .captcha-grid { grid-template-columns: repeat(3, 1fr); }
.captcha-4x4 .captcha-grid { grid-template-columns: repeat(4, 1fr); }

.captcha-grid img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border: 3px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.captcha-grid img.selected {
    border-color: #007bff;
    transform: scale(1.05);
}

/* Scoped button to avoid leaking to other pages */
.captcha button,
.coordinates button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.captcha button:disabled,
.coordinates button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.captcha .btn-secondary,
.coordinates .btn-secondary {
    background: #6c757d;
}

/* Shared thank-you screen */
.captcha .thank-you,
.coordinates .thank-you {
    text-align: center;
    padding: 40px 20px;
}

.captcha .thank-you h2,
.coordinates .thank-you h2 {
    color: #000078;
}

.captcha .thank-you .actions,
.coordinates .thank-you .actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Coordinates exercise */
.coordinates {
    max-width: 820px;
    margin: 20px auto;
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.coordinates-image-wrapper {
    position: relative;
    width: 100%;
    margin: 20px auto;
    border: 3px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    cursor: crosshair;
}

.coordinates-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.click-point {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #dc3545;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
