/* ==========================================================================
   1. Design Tokens & Root Variables
   ========================================================================== */
:root {
    /* Color Palette */
    --primary-deep-blue: #0d2c54;
    --secondary-gold: #c9a66b;
    --text-dark-black: #000000;
    --text-dark-gray: #555555;
    --bg-light-gray: #f8f9fa;
    --border-light: #eef0f2;
    --white: #ffffff;
    
    /* Layout Dimensions */
    --max-width-container: 1200px;
    --header-height: 80px;
    
    /* Animation Speeds */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s ease;
}

/* ==========================================================================
   2. Reset & Core Baseline Styles
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-dark-gray);
    background-color: var(--white);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark-black);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout Container */
.container {
    width: 100%;
    max-width: var(--max-width-container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   3. Header Navigation Matrix
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: background-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.site-header.scrolled {
    background-color: var(--white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.navbar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark-gray);
    position: relative;
    padding: 8px 0;
}

.nav-link:hover,
.nav-link.active-page {
    color: var(--primary-deep-blue);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-gold);
    transition: width var(--transition-smooth);
}

.nav-link:hover::after,
.nav-link.active-page::after {
    width: 100%;
}

/* Mobile Drawer Toggle Button */
.menu-drawer-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1100;
}

.menu-drawer-toggle span {
    width: 28px;
    height: 3px;
    background-color: var(--primary-deep-blue);
    border-radius: 2px;
    transition: var(--transition-smooth);
}

/* ==========================================================================
   4. Shared Component Panels & Elements
   ========================================================================== */
main {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height) - 300px);
}

/* Hero Section */
.ui-hero-panel {
    background: linear-gradient(135deg, var(--primary-deep-blue) 0%, #1a4273 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.ui-hero-panel h1 {
    color: var(--white);
    font-size: 2.8rem;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.ui-hero-panel p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
    line-height: 1.6;
}

/* 2-Column Responsive Matrix Grid */
.layout-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 60px;
    padding: 80px 24px;
    align-items: start;
}

/* Base Form Architecture */
.ui-form-node {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.03);
}

.ui-field-group {
    margin-bottom: 24px;
}

.ui-field-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark-black);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ui-input-element {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    color: var(--text-dark-black);
    background-color: var(--white);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.ui-input-element:focus {
    outline: none;
    border-color: var(--primary-deep-blue);
    box-shadow: 0 0 0 3px rgba(13, 44, 84, 0.1);
}

select.ui-input-element {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Action Button Palette */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.action-btn-primary {
    background-color: var(--primary-deep-blue);
    color: var(--white);
}

.action-btn-primary:hover {
    background-color: #153f73;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 44, 84, 0.2);
}

.action-btn-primary:disabled {
    background-color: #a3b3c6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   5. Footer Environment
   ========================================================================== */
.site-footer {
    background-color: #07162b;
    color: rgba(255, 255, 255, 0.8);
    padding: 60px 0 30px;
    border-top: 4px solid var(--secondary-gold);
}

.footer-matrix {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand {
    flex: 1 1 400px;
}

.footer-brand h3 {
    color: var(--white);
    margin-bottom: 16px;
}

.footer-brand p {
    line-height: 1.6;
}

.footer-nav {
    flex: 1 1 200px;
}

.footer-nav h4 {
    color: var(--white);
    margin-bottom: 16px;
}

.footer-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-nav-list a:hover {
    color: var(--white);
    padding-left: 4px;
}

.footer-meta-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
    font-size: 0.9rem;
}

/* ==========================================================================
   6. Dynamic Donation Modal Overlays
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 44, 84, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 2000;
    transition: opacity 0.3s ease;
}

.modal-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--white);
    width: 100%;
    max-width: 520px;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.is-visible .modal-card {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #94a3b8;
    transition: color var(--transition-fast);
}

.modal-close-btn:hover {
    color: var(--text-dark-black);
}

.modal-title {
    font-size: 1.5rem;
    color: var(--primary-deep-blue);
    margin-bottom: 8px;
    text-align: center;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: var(--text-dark-gray);
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.5;
}

.method-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.method-option-card {
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.method-option-card:hover {
    border-color: var(--primary-deep-blue);
    background-color: #f8fafc;
    transform: translateY(-2px);
}

.method-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.form-row-split {
    display: flex;
    gap: 16px;
}

.form-row-split .ui-field-group {
    flex: 1;
}

/* ==========================================================================
   7. Media Breakpoint Matrices (Responsive Architecture)
   ========================================================================== */
@media (max-width: 992px) {
    .ui-hero-panel h1 { font-size: 2.4rem; }
    .layout-grid-2 { gap: 40px; padding: 60px 24px; }
}

@media (max-width: 768px) {
    .menu-drawer-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: var(--white);
        flex-direction: column;
        gap: 0;
        padding-top: 20px;
        transition: left var(--transition-smooth);
        border-top: 1px solid var(--border-light);
        box-shadow: 0 10px 15px rgba(0,0,0,0.05);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-link {
        display: block;
        padding: 20px 0;
        width: 100%;
        border-bottom: 1px solid var(--border-light);
    }
    
    .nav-link::after { display: none; }

    .layout-grid-2 {
        grid-template-columns: 1fr;
    }

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

    .ui-hero-panel { padding: 60px 0; }
    .ui-hero-panel h1 { font-size: 2rem; }
    .ui-form-node { padding: 30px 20px; }
    .form-row-split { flex-direction: column; gap: 0; }
}