/* =============================================================
   mortgagetrader-modern.css — MortgageTrader.com
   Clean Professional design system with green accent
   Matches Partner/Lender portal pattern (partner-lev.css)
   ============================================================= */

/* ---- Google Font (Inter) ----------------------------------- */
/* Font loaded via <link> tag in DisplayMetaTags() for performance.
   @import fallback kept for static HTML pages that don't use ASP includes. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---- Design Tokens ----------------------------------------- */
:root {
    --bg-app:        #f0f4f8;
    --bg-card:       #ffffff;
    --accent:        #22c55e;
    --accent-dark:   #16a34a;
    --accent-light:  #ecfdf5;
    --navy:          #1e3a5f;
    --navy-dark:     #0f2440;
    --text-primary:  #1e3a5f;
    --text-secondary:#4d6880;
    --text-muted:    #8fa5b8;
    --border:        #dde6ee;
    --border-focus:  #22c55e;
    --table-head:    #f0f5f9;
    --table-alt:     #f8fafb;
    --error:         #ef4444;
    --error-light:   #fef2f2;
    --warning:       #f59e0b;
    --warning-light: #fffbeb;
    --info:          #3b82f6;
    --info-light:    #eff6ff;
    --shadow-sm:     0 1px 3px rgba(26,44,62,.08), 0 1px 2px rgba(26,44,62,.04);
    --shadow-md:     0 4px 16px rgba(26,44,62,.12);
    --radius:        8px;
    --radius-sm:     5px;
    --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Base Reset -------------------------------------------- */
body.mt-body {
    margin: 0;
    padding: 0;
    background: var(--bg-app);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.mt-body * {
    box-sizing: border-box;
}

body.mt-body a {
    color: var(--accent-dark);
    text-decoration: none;
}

body.mt-body a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ---- Container --------------------------------------------- */
.mt-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   HEADER
   ============================================================ */
.mt-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: visible;
}

.mt-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.mt-logo:hover {
    text-decoration: none;
}

.mt-logo svg {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.mt-logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.mt-logo-text .mt-word1 {
    color: var(--navy);
}

.mt-logo-text .mt-word2 {
    color: var(--accent);
}

/* ---- Navigation -------------------------------------------- */
.mt-nav {
    display: flex;
    gap: 0;
    align-items: center;
    height: 100%;
}

.mt-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
}

.mt-nav a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border);
    text-decoration: none;
}

.mt-nav a.mt-nav-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ---- Security Badge ---------------------------------------- */
.mt-secure {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.mt-secure svg {
    width: 14px;
    height: 14px;
    fill: var(--accent);
}

/* ---- Mobile Hamburger (CSS-only) --------------------------- */
.mt-hamburger {
    display: none;
    cursor: pointer;
    width: 28px;
    height: 20px;
    position: relative;
    z-index: 101;
    background: none;
    border: none;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.mt-hamburger span,
.mt-hamburger span::before,
.mt-hamburger span::after {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all .3s ease;
    position: absolute;
}

.mt-hamburger span {
    top: 9px;
}

.mt-hamburger span::before {
    content: '';
    top: -7px;
}

.mt-hamburger span::after {
    content: '';
    top: 7px;
}

/* Hamburger X animation when open */
.mt-hamburger-open span {
    background: transparent;
}

.mt-hamburger-open span::before {
    top: 0;
    transform: rotate(45deg);
}

.mt-hamburger-open span::after {
    top: 0;
    transform: rotate(-45deg);
}

/* ============================================================
   HERO (Homepage only)
   ============================================================ */
.mt-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    padding: 60px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
}

.mt-hero-text {
    max-width: 480px;
}

.mt-hero-text h1 {
    color: #ffffff;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 12px 0;
}

.mt-hero-text h1 span {
    color: #4ade80;
}

.mt-hero-text p {
    color: #94a3b8;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

/* ============================================================
   CARDS
   ============================================================ */
.mt-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
}

.mt-card h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 4px 0;
}

.mt-card .mt-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 20px 0;
}

.mt-quote-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-md);
    width: 400px;
    flex-shrink: 0;
}

/* ============================================================
   FORMS
   ============================================================ */
.mt-form-group {
    margin-bottom: 18px;
}

.mt-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
}

.mt-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin-right: 8px;
    vertical-align: middle;
}

.mt-input,
.mt-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    background: #f8fafb;
    color: var(--text-primary);
    transition: border-color .2s, background .2s;
}

.mt-input:focus,
.mt-select:focus {
    border-color: var(--border-focus);
    outline: none;
    background: #fff;
}

.mt-input-inline {
    width: auto;
    display: inline-block;
}

.mt-select {
    appearance: auto;
}

.mt-checkbox-group {
    display: flex;
    gap: 16px;
    flex-wrap: nowrap;
}

.mt-checkbox-group label {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.mt-checkbox-group input[type="checkbox"],
.mt-checkbox-group input[type="radio"] {
    accent-color: var(--navy);
}

.mt-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mt-radio-group label {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.mt-radio-group input[type="radio"] {
    accent-color: var(--navy);
}

body.mt-body .mt-btn,
.mt-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: background .2s;
    text-align: center;
    text-decoration: none;
}

body.mt-body .mt-btn:hover,
.mt-btn:hover {
    background: var(--accent-dark);
    text-decoration: none;
    color: #ffffff;
}

.mt-btn-full {
    width: 100%;
}

.mt-btn-secondary {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: border-color .2s;
    text-decoration: none;
}

.mt-btn-secondary:hover {
    border-color: var(--accent);
    text-decoration: none;
}

/* ============================================================
   TABLES (Rate Results)
   ============================================================ */
.mt-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.mt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mt-table thead th {
    background: var(--table-head);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--navy);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.mt-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.mt-table tbody tr:nth-child(even) {
    background: var(--table-alt);
}

.mt-table tbody tr:hover {
    background: var(--accent-light);
}

/* ============================================================
   INFO SECTION (Value Props)
   ============================================================ */
.mt-info-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 50px 0;
}

.mt-info-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 24px;
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.mt-info-card .mt-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 20px;
}

.mt-info-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    margin: 0 0 6px 0;
}

.mt-info-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* ============================================================
   RESOURCE LINKS
   ============================================================ */
.mt-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding-bottom: 40px;
}

.mt-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: border-color .2s, box-shadow .2s;
}

.mt-link-item:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(34,197,94,.12);
    text-decoration: none;
}

.mt-link-arrow {
    color: var(--accent);
    font-size: 16px;
    flex-shrink: 0;
}

/* ============================================================
   ALERTS / ERROR STATES
   ============================================================ */
.mt-alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.mt-alert-error {
    background: var(--error-light);
    border-left: 4px solid var(--error);
    color: #991b1b;
}

.mt-alert-warning {
    background: var(--warning-light);
    border-left: 4px solid var(--warning);
    color: #92400e;
}

.mt-alert-info {
    background: var(--info-light);
    border-left: 4px solid var(--info);
    color: #1e40af;
}

/* ============================================================
   PAGE HEADING
   ============================================================ */
.mt-page-header {
    padding: 30px 0 20px;
}

.mt-page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 6px 0;
}

.mt-page-header p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================================
   LENDER COUNT
   ============================================================ */
.mt-lender-count {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ============================================================
   SORT BAR
   ============================================================ */
.mt-sort-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.mt-sort-bar label {
    font-weight: 600;
}

.mt-sort-bar select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font);
    background: var(--bg-card);
}

/* ============================================================
   TWO-COLUMN LAYOUT (sidebar + main)
   ============================================================ */
.mt-two-col {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.mt-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.mt-main {
    flex: 1;
    min-width: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
.mt-footer {
    background: var(--navy);
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
}

.mt-footer-left {
    font-size: 12px;
    color: #64748b;
    line-height: 1.8;
}

.mt-footer-left a {
    color: #4ade80;
}

.mt-footer-right {
    font-size: 12px;
    color: #64748b;
    text-align: right;
    line-height: 1.8;
}

/* ============================================================
   POPUP / WIDGET CHROME (lighter — no full nav)
   ============================================================ */
.mt-popup-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mt-popup-header svg {
    width: 28px;
    height: 28px;
}

.mt-popup-header .mt-logo-text {
    font-size: 18px;
}

/* ============================================================
   MODAL OVERLAY (lender_info, etc.)
   ============================================================ */
.mt-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 36, 64, 0.6);
    backdrop-filter: blur(2px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.mt-modal-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mt-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.mt-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--navy);
}

.mt-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .15s, color .15s;
}

.mt-modal-close:hover {
    background: var(--bg-app);
    color: var(--text-primary);
}

.mt-modal-iframe {
    flex: 1;
    width: 100%;
    border: none;
}

/* ============================================================
   PLANNER MODULE
   ============================================================ */
.mt-planner-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.mt-planner-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
}

.mt-planner-nav {
    display: flex;
    flex-direction: column;
}

.mt-planner-nav-section {
    padding: 10px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.mt-planner-nav-link {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background .15s, border-color .15s;
}

.mt-planner-nav-link:hover {
    background: var(--accent-light);
    color: var(--text-primary);
    text-decoration: none;
}

.mt-planner-nav-active {
    border-left-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent-dark);
    font-weight: 600;
}

.mt-planner-main {
    flex: 1;
    min-width: 0;
}

/* Wizard Step Indicator */
.mt-wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
    padding: 16px 0;
}

.mt-wizard-step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.mt-wizard-step.mt-wizard-active {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 0 0 4px var(--accent-light);
}

.mt-wizard-step.mt-wizard-done {
    background: var(--accent-dark);
    color: #ffffff;
}

.mt-wizard-connector {
    width: 40px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
}

.mt-wizard-connector.mt-wizard-connector-done {
    background: var(--accent-dark);
}

.mt-wizard-num {
    line-height: 1;
}

.mt-wizard-content {
    flex: 1;
}

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 1024px) {
    .mt-hero {
        flex-direction: column;
        padding: 40px 24px;
        gap: 30px;
        text-align: center;
    }

    .mt-hero-text {
        max-width: 100%;
    }

    .mt-quote-card {
        width: 100%;
        max-width: 450px;
    }

    .mt-info-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .mt-two-col {
        flex-direction: column;
    }

    .mt-sidebar {
        width: 100%;
    }

    .mt-planner-layout {
        flex-direction: column;
    }

    .mt-planner-sidebar {
        width: 100%;
        position: static;
    }

    .mt-header {
        padding: 0 24px;
    }

    .mt-footer {
        padding: 24px;
    }

    .mt-modal-overlay {
        padding: 0;
    }

    .mt-modal-container {
        max-width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 768px) {
    .mt-checkbox-group {
        flex-wrap: wrap;
    }

    .mt-hamburger {
        display: block;
    }

    .mt-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #ffffff;
        flex-direction: column;
        align-items: stretch;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 8px 24px rgba(0,0,0,.15);
        z-index: 1000;
    }

    .mt-nav.mt-nav-open {
        display: flex;
    }

    .mt-nav a {
        display: block;
        width: 100%;
        padding: 14px 24px;
        height: auto;
        background: #ffffff;
        border-bottom: 1px solid var(--border);
        border-left: 3px solid transparent;
        box-sizing: border-box;
        color: var(--text-primary);
    }

    .mt-nav a:last-child {
        border-bottom: none;
    }

    .mt-nav a.mt-nav-active {
        border-left-color: var(--accent);
        background: var(--accent-light);
    }

    .mt-secure {
        display: none;
    }

    .mt-hero {
        padding: 30px 16px;
    }

    .mt-hero-text h1 {
        font-size: 26px;
    }

    .mt-quote-card {
        padding: 24px 20px;
    }

    .mt-info-section {
        grid-template-columns: 1fr;
        padding: 30px 0;
    }

    .mt-links {
        grid-template-columns: 1fr;
    }

    .mt-footer {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 24px 16px;
    }

    .mt-footer-right {
        text-align: center;
    }

    .mt-wizard-connector {
        width: 20px;
    }

    .mt-wizard-step {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .mt-container {
        padding: 0 16px;
    }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .mt-header,
    .mt-footer,
    .mt-hamburger {
        display: none !important;
    }

    body.mt-body {
        background: #fff;
        font-size: 12px;
    }

    .mt-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .mt-table {
        font-size: 11px;
    }

    .mt-container {
        max-width: 100%;
        padding: 0;
    }
}
