/* Global branding and layout */
:root {
    color-scheme: light;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #0f172a;
    background: #f8fafc;

    --primary-blue: #1E5AC8;
    --dark-blue: #0D2D62;
    --gold: #F6F2DD;
    --green: #10B981;
    --red: #EF4444;
    --white: #FFFFFF;
    --light-gray: #F1F5F9;
    --black: #090B1A;

    --royal: var(--primary-blue);
    --dark: var(--dark-blue);
    --cream: var(--gold);
    --surface: var(--white);
    --surface-muted: var(--light-gray);
    --border: rgba(13, 45, 98, 0.12);
    --accent: var(--primary-blue);
    --accent-soft: rgba(30, 90, 200, 0.12);
    --text-muted: #475569;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.6;
    background: radial-gradient(circle at top, rgba(30, 90, 200, 0.08), transparent 34%), var(--light-gray);
    color: var(--text-muted);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--accent);
    transition: color 180ms ease, transform 180ms ease;
}

a:hover {
    color: #0f172a;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

#manu-newsletter-form {
    width: 100%;
    max-width: 760px;
}

#manu-newsletter-form .form-control {
    min-width: 0;
}

.manu-newsletter-button {
    background: var(--gold) !important;
    color: #041528 !important;
    font-weight: 700 !important;
    border: none !important;
}

.manu-newsletter-button:hover,
.manu-newsletter-button:focus {
    background: #d4b84d !important;
    color: #041528 !important;
}

.bg-royal {
    background: var(--primary-blue) !important;
    color: #ffffff !important;
}

.benefit-card {
    min-height: 180px !important;
}

.container,
.page-container {
    width: min(1200px, calc(100% - 2rem));
    margin: 0 auto;
}

.page-header {
    padding: 3rem 0 2rem;
}

.page-header h1,
.page-header h2,
.page-header h3 {
    color: #0f172a;
    margin: 0;
}

.section-heading {
    margin: 3.5rem auto 1.25rem;
    text-align: center;
    max-width: 760px;
}

.section-heading h2 {
    font-size: clamp(2rem, 2.5vw, 2.6rem);
    line-height: 1.05;
    color: #0f172a;
}

.section-heading p {
    margin-top: 1rem;
    color: #64748b;
    font-size: 1rem;
}

.site-header,
.page-nav {
    background: #ffffff;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    position: sticky;
    top: 0;
    z-index: 1050;
}

.container.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.site-header .brand,
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
}

.brand-logo {
    display: inline-block;
    width: 3rem;
    height: 3rem;
    object-fit: contain;
    border-radius: 0.65rem;
}

.brand-text {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    line-height: 1.05;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--dark-blue);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.brand-tagline {
    display: block;
    font-size: 0.75rem;
    color: #475569;
    margin-top: 0.15rem;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.brand-search {
    position: relative;
    z-index: 1100;
}

.brand-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(13, 45, 98, 0.16);
    background: #ffffff;
    color: var(--dark-blue);
    border-radius: 9999px;
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    position: relative;
    z-index: 1101;
}

.brand-search-toggle svg {
    width: 1.1rem;
    height: 1.1rem;
}

.brand-search-form {
    position: absolute;
    right: 0;
    top: calc(100% + 0.55rem);
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid rgba(13, 45, 98, 0.16);
    border-radius: 9999px;
    padding: 0.4rem 0.75rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    min-width: 220px;
    color: #0f172a;
}

.brand-search-form.open {
    display: flex;
}

.brand-tagline {
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    opacity: 0.95;
}

.nav-links,
.nav-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    align-items: center;
}

.nav-links {
    gap: 1.4rem;
}

.nav-link,
.heading-link,
.btn-ghost {
    color: #475569;
    transition: color 180ms ease, transform 180ms ease;
    text-decoration: none;
    font-weight: 500;
}

.nav-link:hover,
.heading-link:hover,
.btn-ghost:hover {
    color: #0f172a;
    transform: translateY(-1px);
}

.nav-link.active {
    color: #0f172a;
    font-weight: 700;
}

.nav-links .dropdown {
    position: relative;
}

.nav-links .dropdown .dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.nav-links .dropdown .dropdown-trigger::after {
    content: '▾';
    font-size: 0.78rem;
    transition: transform 180ms ease;
}

.nav-links .dropdown:hover .dropdown-trigger::after,
.nav-links .dropdown:focus-within .dropdown-trigger::after {
    transform: rotate(180deg);
}

.nav-links .dropdown .dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    background: var(--white);
    border-radius: 1rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 1060;
}

.nav-links .dropdown .dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 180ms ease, color 180ms ease;
}

.nav-links .dropdown .dropdown-item:hover {
    background: var(--surface-muted);
    color: var(--dark-blue);
}

.nav-links .dropdown:hover .dropdown-content,
.nav-links .dropdown:focus-within .dropdown-content {
    display: block;
}

.nav-links .dropdown .dropdown-trigger {
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    padding: 0;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-links .dropdown .dropdown-content {
        position: static;
        box-shadow: none;
        border-radius: 0.95rem;
    }
}

.nav-actions {
    gap: 0.85rem;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
}

/* Mobile navigation toggle styles */
.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 0.25rem;
    line-height: 0;
}

@media (max-width: 768px) {
    .container.nav {
        position: relative;
        padding-left: 1rem;
        padding-right: 1rem;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
    }

    .container.nav {
        position: relative;
        padding-left: 1rem;
        padding-right: 4.5rem;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
    }

    .brand-panel {
        display: flex;
        flex-direction: row;
        flex: 1 1 auto;
        min-width: 0;
        gap: 0.75rem;
        align-items: flex-start;
        width: auto;
        padding-right: 4rem;
    }

    .brand {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
        width: 100%;
        min-width: 0;
    }

    .brand-logo {
        flex: 0 0 auto;
        width: 3rem;
        height: 3rem;
        margin-top: 0.15rem;
    }

    .brand-text {
        display: flex;
        flex-direction: column;
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
        overflow-wrap: break-word;
    }

    .brand-title,
    .brand-tagline {
        display: block;
        width: 100%;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    .brand-title {
        max-width: 100%;
        font-size: 1rem;
        line-height: 1.3;
    }

    .brand-tagline {
        font-size: 0.8rem;
        color: #475569;
        margin-top: 0.15rem;
    }

    .brand-search {
        display: none !important;
        position: absolute;
        top: 0.7rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1060;
    }

    .brand-search-toggle {
        display: none !important;
        margin: 0;
    }

    .brand-search-form,
    .brand-search-form.open {
        display: none !important;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 3rem;
        width: 3rem;
        padding: 0;
        box-sizing: border-box;
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        z-index: 1120;
        margin: 0;
        background: #ffffff;
        border: 1px solid rgba(15, 23, 42, 0.1);
        border-radius: 0.85rem;
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    }

    .brand-panel {
        padding-right: 4rem;
    }

    .container.nav {
        min-height: 4rem;
        align-items: center;
    }

    .brand-panel,
    .brand {
        margin: 0;
    }

    .brand-title {
        max-width: calc(100% - 3.5rem);
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        padding: 0.75rem 1rem;
        box-shadow: 0 12px 32px rgba(15,23,42,0.08);
        flex-direction: column;
        gap: 0.6rem;
        z-index: 1040;
    }

    .nav-links.show {
        display: flex;
    }
    .nav-actions {
        gap: 0.5rem;
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }

    /* Mobile-only CTA inside collapsed nav */
    .mobile-only {
        display: none;
        text-decoration: none;
        align-items: center;
    }

    .cta-mobile {
        background: var(--primary-blue);
        color: var(--white);
        padding: 0.6rem 1rem;
        border-radius: 0.45rem;
        font-weight: 700;
        display: inline-flex;
        justify-content: center;
    }

    .nav-toggle svg {
        display: block;
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* Page contrast improvements for MANU landing sections */
.manu-hero h1,
.manu-hero h2,
.manu-hero p,
.manu-hero .lead,
.manu-hero .hero-badge {
    color: #ffffff !important;
}

.event-card .card-title,
.event-card .text-muted,
.resource-card h5,
.resource-card p,
.resource-card .btn {
    color: #111827 !important;
}

.resource-card,
.event-card,
.manu-card {
    background: #ffffff !important;
}

.resource-card .card-body,
.event-card .card-body {
    color: #111827 !important;
}

/* Hide desktop CTA and show mobile CTA when nav is collapsed */
@media (max-width: 991.98px) {
    .nav-actions { display: none !important; }
    .mobile-only { display: inline-flex; }
    .nav-links { flex-direction: column; }
    .nav-links .nav-link { padding: 0.6rem 0; }
}

.button,
.btn,
.x-primary-button,
.btn-primary {
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    padding: 0.95rem 1.6rem;
    border: none;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.button-primary,
.btn-primary,
.x-primary-button {
    background: var(--primary-blue);
    color: var(--white);
    box-shadow: 0 18px 32px rgba(30, 90, 200, 0.18);
}

.button-secondary,
.btn-secondary,
.btn-outline-primary {
    background: rgba(30, 90, 200, 0.08);
    color: var(--dark-blue);
    border: 1px solid rgba(30, 90, 200, 0.16);
}

.button:hover,
.btn:hover,
.x-primary-button:hover {
    transform: translateY(-1px);
}

.brand {
    color: var(--dark-blue);
    font-weight: 800;
}

.site-header,
.navbar {
    background: var(--white);
    border-bottom: 1px solid rgba(13, 45, 98, 0.08);
    position: sticky;
    top: 0;
    z-index: 1050;
    backdrop-filter: saturate(180%) blur(10px);
}

.navbar {
    background: rgba(255, 255, 255, 0.97);
}

.navbar .navbar-nav .nav-link {
    color: var(--black);
    transition: color 180ms ease;
}

.navbar .navbar-nav .nav-link.active,
.navbar .navbar-nav .nav-link:hover {
    color: var(--primary-blue);
}

.navbar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}

.navbar-collapse {
    display: flex !important;
    flex-basis: auto;
}

.navbar-nav {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
}

.navbar-brand {
    color: var(--dark-blue) !important;
}

.navbar-toggler {
    border-color: rgba(13, 45, 98, 0.16);
}

.site-header .brand,
.brand {
    color: var(--dark-blue);
}

.card,
.section-card,
.hero-card,
.dashboard-card,
.profile-summary,
.timeline-card,
.activity-timeline,
.notification-card,
.resource-card,
.opportunity-card,
.payment-record,
.registered-event,
.event-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.6rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
}

.card-body,
.panel-body,
.page-panel,
.form-panel {
    padding: 1.75rem;
}

.hero,
.dashboard-shell,
.page-hero,
.page-banner {
    border-radius: 2rem;
}

.hero {
    border-radius: 0 !important;
}

@media (max-width: 768px) {
    .brand-panel {
        align-items: center;
        flex-wrap: nowrap;
        gap: 0.75rem;
    }

    .brand {
        flex: 1 1 auto;
        min-width: 0;
    }

    .brand-logo {
        width: 2.6rem;
        height: 2.6rem;
        margin-top: 0;
        flex-shrink: 0;
    }

    .brand-text {
        flex: 1 1 1px;
        min-width: 0;
        overflow-wrap: normal;
    }

    .brand-title {
        font-size: 0.88rem !important;
        line-height: 1.15 !important;
    }

    .brand-tagline {
        font-size: 0.72rem !important;
        line-height: 1.2 !important;
    }
}

@media (max-width: 520px) {
    .brand-logo {
        width: 2.2rem;
        height: 2.2rem;
    }

    .brand-title {
        font-size: 0.82rem !important;
    }

    .brand-tagline {
        font-size: 0.68rem !important;
    }
}

@media (max-width: 520px) {
    .brand-logo {
        width: 2.5rem;
        height: 2.5rem;
    }
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select,
.x-text-input {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: #ffffff;
    color: #0f172a;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus,
.x-text-input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

form {
    width: 100%;
}

form > div {
    margin-bottom: 1.15rem;
}

x-auth-session-status,
.x-auth-session-status,
.auth-session-status {
    display: block;
    margin-bottom: 1rem;
}

.auth-card,
.card.auth,
.guest-card {
    padding: 2rem;
    background: #ffffff;
    border-radius: 1.75rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.auth-card .section-heading,
.auth-card h2,
.auth-card h3 {
    color: #0f172a;
}

footer {
    padding: 3rem 0;
    text-align: center;
    color: #667085;
}

@media (max-width: 1024px) {
    .container,
    .page-container {
        width: calc(100% - 2rem);
    }
}

@media (max-width: 768px) {
    .site-header .nav,
    .navbar .nav,
    .nav-links,
    .nav-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header {
        padding: 2rem 0 1.5rem;
    }
}
