# Money365 front-end header styles
.header-nav .nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.5rem;
    padding: 0 0.15rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    color: #334155;
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s ease;
}

.header-nav .nav-link:hover,
.header-nav .nav-link.active {
    color: #d97706;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: 5rem;
    min-width: 0;
    width: 100%;
}

.header-nav {
    display: none;
    align-items: center;
    gap: 0.85rem;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}

.header-actions {
    display: none;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
}

.header-actions .partner-register {
    display: none;
}

@media (min-width: 1024px) {
    .header-nav { display: flex; }
    .header-actions { display: flex !important; }
}

@media (min-width: 1280px) {
    .header-bar { gap: 1.25rem; }
    .header-nav { gap: 1.35rem; }
    .header-actions { gap: 0.55rem; }
    .header-actions .partner-register { display: inline-flex; }
}

.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 5rem; /* full header height so hover never drops in the gap */
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% - 0.75rem);
    left: 50%;
    transform: translateX(-50%);
    min-width: 260px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.18);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 80;
}

/* Invisible bridge so cursor can move into the menu */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -1rem;
    height: 1rem;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.65rem 0.9rem;
    border-radius: 0.75rem;
    color: #334155;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-dropdown-menu a:hover {
    background: #fffbeb;
    color: #d97706;
}

.nav-dropdown > .nav-link .chevron {
    transition: transform 0.2s ease;
    font-size: 0.625rem;
    color: #94a3b8;
}

.nav-dropdown:hover > .nav-link .chevron,
.nav-dropdown.open > .nav-link .chevron,
.nav-dropdown:focus-within > .nav-link .chevron {
    transform: rotate(180deg);
    color: #d97706;
}

.partner-link {
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.header-actions .partner-link {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0 0.55rem;
}

.partner-link:hover {
    color: #d97706;
}

.site-footer a:hover {
    color: #fbbf24;
}

/* Compact Apply Loan Modal */
.apply-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none !important;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.apply-modal.is-open {
    display: flex !important;
}

.apply-modal-dialog {
    width: 100%;
    max-width: 480px;
    max-height: min(92vh, 640px);
    margin: auto;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.apply-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.apply-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.apply-modal-sub {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}

.apply-modal-close {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 0.55rem;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
}

.apply-modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.apply-modal-form {
    padding: 0.9rem 1rem 1rem;
    overflow-y: auto;
}

.apply-modal-form .form-group {
    margin-bottom: 0.65rem;
}

.apply-modal-form .form-group label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
}

.apply-modal-form .form-control {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    border-radius: 0.6rem;
    border: 1px solid #e2e8f0;
}

.apply-modal-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.apply-modal-form textarea.form-control {
    resize: vertical;
    min-height: 56px;
}

.apply-modal-submit {
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
    padding: 0.7rem 1rem;
}

.apply-modal-secure {
    margin: 0.75rem 0 0;
    text-align: center;
    font-size: 0.72rem;
    color: #94a3b8;
}

.apply-modal-secure i {
    color: #10b981;
    margin-right: 0.25rem;
}

.header-actions .apply-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 2.55rem;
    padding: 0 0.95rem;
    border: 0;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
}

@media (min-width: 1280px) {
    .header-actions .apply-btn {
        height: 2.65rem;
        padding: 0 1.15rem;
        font-size: 0.9rem;
        gap: 0.45rem;
    }
}

@media (max-width: 640px) {
    .apply-modal {
        padding: 0.5rem;
        align-items: flex-start;
    }

    .apply-modal-dialog {
        max-height: 96vh;
        margin-top: 0.5rem;
    }

    .apply-modal-form .form-row {
        grid-template-columns: 1fr;
    }
}
