@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap");

:root {
    --primary-color: #d71013;
    --secondary-color: #044e8d;
    --accent-color: #044e8d;
    --header-bg-color: #111111;
    --background-color: #f4f4f4;
    --surface-color: #ffffff;
    --muted-surface: #e8edf2;
    --text-color: #222222;
    --muted-text: #5b6570;
    --border-color: #d8dde3;
    --font-body: "Roboto", Arial, sans-serif;
    --font-heading: "Roboto", Arial, sans-serif;
    --spacer: 1rem;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
    margin: 0;
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background-color);
}
a { color: var(--accent-color); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
button, input, textarea { font: inherit; }

.site-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    background: #ffffff;
}
.top-strip {
    background: var(--header-bg-color);
    color: #ffffff;
    font-size: .9rem;
}
.top-strip-inner {
    min-height: 38px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}
.top-strip a { color: #ffffff; }

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 20px 0;
}
.brand-logo {
    display: inline-flex;
    align-items: center;
    background: transparent;
    padding: 0;
}
.brand-logo img {
    display: block;
    width: auto;
    height: clamp(32px, 5vw, 44px);
    max-width: min(220px, 52vw);
    object-fit: contain;
}
.site-search {
    display: flex;
    width: min(420px, 100%);
    border: 1px solid var(--border-color);
    background: #ffffff;
}
.site-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    padding: 12px 14px;
}
.site-search button,
.btn {
    border: 0;
    border-radius: 4px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
}
.site-search button,
.btn.primary {
    background: var(--primary-color);
    color: #ffffff;
}
.language-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.language-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: #ffffff;
    color: var(--accent-color);
    font-weight: 800;
    font-size: .82rem;
}
.language-switcher a:hover,
.language-switcher a.active {
    background: var(--accent-color);
    color: #ffffff;
    text-decoration: none;
}
.btn.secondary {
    background: #ffffff;
    color: var(--accent-color);
    border: 1px solid rgba(4,78,141,.24);
}
.btn:hover { text-decoration: none; filter: brightness(.96); }

.primary-nav {
    background: var(--accent-color);
    position: relative;
    z-index: 5;
}
.nav-scroll {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 2px;
    min-height: 48px;
    overflow: visible;
}
.primary-nav a {
    display: flex;
    align-items: center;
    color: #ffffff;
    padding: 13px 14px;
    font-weight: 700;
    white-space: nowrap;
}
.primary-nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.nav-item { position: relative; display: flex; }
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 18px 38px rgba(0,0,0,.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: .16s ease;
}
.nav-item:hover .submenu,
.nav-item:focus-within .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.submenu a {
    color: var(--text-color);
    padding: 12px 14px;
}
.submenu a:hover { background: var(--muted-surface); }

#main { min-height: 58vh; }
.home-hero {
    min-height: 520px;
    background: linear-gradient(120deg, var(--header-bg-color), var(--accent-color));
    background-size: cover;
    background-position: center;
    color: #ffffff;
    display: flex;
    align-items: center;
}
.hero-inner { max-width: 760px; padding: 70px 0; }
.eyebrow {
    color: var(--primary-color);
    font-weight: 900;
    text-transform: uppercase;
    font-size: .82rem;
    margin: 0 0 10px;
}
.home-hero .eyebrow { color: #ffffff; }
h1, h2, h3 {
    font-family: var(--font-heading);
    line-height: 1.18;
    margin: 0;
    color: inherit;
}
h1 { font-size: clamp(2.2rem, 5vw, 4.8rem); max-width: 900px; }
h2 { font-size: clamp(1.55rem, 3vw, 2.4rem); }
h3 { font-size: 1.18rem; }
.home-hero p {
    max-width: 720px;
    font-size: 1.18rem;
    margin: 22px 0 0;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }

.section { padding: 70px 0; }
.section-heading { max-width: 720px; margin-bottom: 28px; }
.service-grid, .quote-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.service-card,
.listing-card,
.content-body,
.service-widget,
.calculator-panel,
.application-form,
.faq-list details {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0,0,0,.06);
}
.service-card {
    display: block;
    min-height: 230px;
    padding: 26px;
    color: var(--text-color);
}
.service-card:hover { text-decoration: none; border-color: var(--accent-color); }
.service-card span {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 900;
    margin-bottom: 26px;
}
.service-card p, .content-body p, .listing-card p { color: var(--muted-text); }

.calculator-band {
    background: linear-gradient(135deg, rgba(4,78,141,.10), rgba(215,16,19,.08));
}
.calc-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    gap: 28px;
    align-items: stretch;
}
.calculator-panel,
.application-form,
.service-widget {
    padding: 28px;
}
label {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    color: var(--text-color);
    font-size: .94rem;
    font-weight: 800;
}
label > span {
    display: block;
    line-height: 1.25;
}
input, textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 13px 14px;
    background: #ffffff;
    color: var(--text-color);
    line-height: 1.35;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
input::placeholder,
textarea::placeholder { color: #8a95a3; }
input:focus,
textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(4,78,141,.14);
}
input:user-invalid,
textarea:user-invalid {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(215,16,19,.12);
}
textarea { min-height: 126px; resize: vertical; }
.calc-result {
    margin-top: 24px;
    padding: 18px;
    background: var(--accent-color);
    color: #ffffff;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
.application-form .btn,
.inline-contact-form .btn,
.contact-form-panel .btn {
    width: 100%;
    margin-top: 18px;
    min-height: 48px;
}
.form-page-shell {
    display: grid;
    grid-template-columns: minmax(0, 560px);
    justify-content: center;
}
.contact-form-panel {
    width: 100%;
}
.alert {
    width: min(1180px, calc(100% - 40px));
    margin: 18px auto 0;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(0,0,0,.06);
}
.alert-success {
    background: #e8f6ee;
    border-color: #afd7bf;
    color: #12562c;
}
.alert-danger {
    background: #fff0f0;
    border-color: #f0b9b9;
    color: #8f1113;
}
.alert-info {
    background: #eef6ff;
    border-color: #bad7f5;
    color: #123f6e;
}
.alert-warning {
    background: #fff8e8;
    border-color: #ead29b;
    color: #6e4a00;
}
.alert .close {
    float: right;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.about-band { background: #ffffff; }
.two-col, .contact-grid {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 42px;
    align-items: start;
}
.text-link { font-weight: 900; color: var(--primary-color); }
.quote-grid blockquote {
    margin: 0;
    padding: 24px;
    background: #ffffff;
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 12px 28px rgba(0,0,0,.06);
}
.contacts-band { background: var(--header-bg-color); color: #ffffff; }
.contacts-band p { color: rgba(255,255,255,.78); }
.contact-actions { display: flex; gap: 14px; justify-content: flex-end; flex-wrap: wrap; }
.faq-list { display: grid; gap: 12px; }
.faq-list details { padding: 18px 20px; }
.faq-list summary { cursor: pointer; font-weight: 900; }

.error-page { padding: 64px 0 72px; text-align: center; }
.error-content { max-width: 640px; margin: 0 auto; }
.error-code { font-size: 5rem; font-weight: 900; line-height: 1; margin: 0; color: var(--primary-color); }
.error-title { margin: 8px 0 12px; }
.error-message { color: var(--muted-text); margin: 0 0 28px; }
.error-search { justify-content: center; margin: 0 auto 28px; max-width: 420px; }
.error-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.error-actions .btn { cursor: pointer; border: none; font: inherit; }
.error-popular { text-align: left; }
.error-popular h2 { text-align: center; margin-bottom: 20px; }
.error-popular .service-card { min-height: auto; padding: 18px 22px; }
.error-popular .service-card h3 { margin: 0; }

@media (max-width: 640px) {
    .error-code { font-size: 3.5rem; }
    .error-actions { flex-direction: column; align-items: stretch; }
}

.page-hero {
    background: linear-gradient(135deg, var(--header-bg-color), var(--accent-color));
    color: #ffffff;
}
.page-hero.compact { padding: 46px 0 50px; }
.page-hero p { max-width: 760px; color: rgba(255,255,255,.84); margin: 14px 0 0; }
.breadcrumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
    font-size: .94rem;
}
.breadcrumbs a { color: #ffffff; }
.breadcrumbs span { color: rgba(255,255,255,.78); }
.breadcrumbs > * + *::before {
    content: "/";
    margin-right: 8px;
    color: rgba(255,255,255,.5);
}
.publish-date { display: block; margin-top: 14px; color: rgba(255,255,255,.78); }

.listing-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.listing-card { padding: 24px; min-height: 190px; }
.listing-card time { color: var(--primary-color); font-weight: 700; font-size: .92rem; }
.listing-card h2 { font-size: 1.24rem; margin-top: 10px; }
.listing-card p { margin-bottom: 0; }

.search-results .listing-list { grid-template-columns: 1fr; }
.search-results .listing-card {
    display: flex;
    align-items: baseline;
    gap: 24px;
    min-height: 0;
}
.search-results .listing-card time { flex: 0 0 140px; }
.search-results .listing-card h2 { margin-top: 0; flex: 0 0 320px; }
.search-results .listing-card p { flex: 1 1 auto; color: var(--muted-text); }
.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 820px);
    justify-content: center;
}
.content-layout.service-layout,
.content-layout.has-sidebar {
    grid-template-columns: minmax(0, 760px) 340px;
    gap: 24px;
    align-items: start;
}
.content-body {
    padding: 34px;
    overflow-wrap: anywhere;
}
.content-body .lead {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 500;
}
.service-widget,
.article-sidebar {
    position: sticky;
    top: 18px;
}
.service-widget .btn { display: block; text-align: center; margin-top: 18px; }

.article-offers { margin: 24px 0 32px; }
.article-offers-title { margin: 0 0 16px; font-size: 1.15rem; }
.article-offers .credit-offers { gap: 14px; justify-content: flex-start; }
.article-offers .credit-offer-card { max-width: 240px; }
.article-offers-more { margin: 14px 0 0; text-align: right; }
.article-offers-more a { font-weight: 700; color: var(--primary-color); }

.article-sidebar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0,0,0,.06);
    padding: 26px;
}
.article-sidebar h2 { margin-top: 0; font-size: 1.1rem; }
.related-articles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.related-articles li { border-bottom: 1px solid var(--border-color); padding-bottom: 12px; }
.related-articles li:last-child { border-bottom: none; padding-bottom: 0; }
.related-articles a { font-weight: 700; color: var(--text-color); }
.related-articles a:hover { color: var(--primary-color); }
.related-articles-cta { display: block; text-align: center; margin-top: 20px; }
.inline-contact-form {
    margin-top: 28px;
    display: grid;
    gap: 12px;
}
.result-summary { font-weight: 700; margin-top: 0; }

.site-footer {
    background: #d7dce2;
    color: var(--text-color);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
    padding: 42px 0;
}
.site-footer h2 {
    font-size: 1rem;
    margin-bottom: 14px;
}
.site-footer a {
    display: block;
    margin: 8px 0;
    font-weight: 700;
}
.footer-bottom {
    background: var(--accent-color);
    color: #ffffff;
    text-align: center;
    padding: 14px;
    font-size: .92rem;
}

@media (max-width: 900px) {
    .header-main,
    .top-strip-inner,
    .two-col,
    .contact-grid,
    .calc-grid,
    .content-layout.service-layout,
    .content-layout.has-sidebar,
    .footer-grid {
        grid-template-columns: 1fr;
        display: grid;
    }
    .header-main { justify-items: start; }
    .site-search { width: 100%; }
    .language-switcher { margin-left: 0; }
    .nav-scroll {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .service-grid,
    .quote-grid,
    .listing-list {
        grid-template-columns: 1fr;
    }
    .contact-actions { justify-content: flex-start; }
    .search-results .listing-card { flex-direction: column; align-items: flex-start; gap: 8px; }
    .search-results .listing-card time,
    .search-results .listing-card h2 { flex: none; }
}

@media (max-width: 560px) {
    .site-shell { width: min(100% - 24px, 1180px); }
    .home-hero { min-height: 460px; }
    .section { padding: 46px 0; }
    .content-body,
    .calculator-panel,
    .application-form,
    .service-widget,
    .article-sidebar,
    .listing-card { padding: 20px; }
    .article-offers .credit-offer-card { max-width: none; }
    .hero-actions,
    .contact-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .btn { text-align: center; }
}

/* Credit offers list */
.credit-offers {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}
.credit-offer-card {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    padding: 24px 20px;
    flex: 1 1 calc(33.333% - 14px);
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.credit-offer-card:hover {
    box-shadow: 0 10px 24px rgba(0,0,0,.1);
    border-color: color-mix(in srgb, var(--accent-color) 35%, var(--border-color));
    transform: translateY(-2px);
}
.offer-header {
    margin-bottom: 18px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}
.offer-logo-link {
    display: inline-block;
    line-height: 0;
    transition: opacity .2s ease, transform .2s ease;
}
.offer-logo-link:hover,
.offer-logo-link:focus-visible {
    opacity: .85;
    transform: scale(1.03);
}
.offer-logo {
    width: 200px;
    height: 140px;
    object-fit: contain;
    display: block;
}
.offer-logo-text {
    font-weight: 700;
    font-size: 18px;
    color: var(--accent-color);
}
.offer-parameters {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    flex-shrink: 0;
}
.offer-param-row {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 6px;
    font-size: 14px;
    text-align: center;
}
.offer-param-row .param-label { color: #6b7280; }
.offer-param-row .param-value { font-weight: 600; color: var(--text-color); }
.offer-separator {
    height: 1px;
    width: 100%;
    background: var(--border-color);
    margin: 16px 0;
    flex-shrink: 0;
}
.offer-apr {
    flex-shrink: 0;
    width: 100%;
    background: color-mix(in srgb, var(--accent-color) 6%, transparent);
    border-radius: 10px;
    padding: 10px 12px;
}
.offer-apr .apr-label { font-size: 12px; color: #6b7280; margin-bottom: 4px; text-align: center; }
.offer-apr .apr-values { font-size: 16px; font-weight: 700; color: var(--accent-color); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; align-items: baseline; }
.offer-info-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    flex-shrink: 0;
    text-align: center;
}
.info-link {
    font-size: 12px;
    color: #6b7280;
    text-decoration: underline;
    cursor: pointer;
}
.info-link:hover { color: var(--accent-color); }
.offer-action { margin-top: 16px; padding-top: 0; width: 100%; }
.offer-action .btn { width: 100%; text-align: center; cursor: pointer; }
.no-offers {
    padding: 24px;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    text-align: center;
    color: #6b7280;
    width: 100%;
}
.content-lead {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 500;
    margin-bottom: 28px;
    max-width: 760px;
}
.content-description { margin-top: 28px; }
.offers-meta { margin-top: 8px; color: rgba(255,255,255,.75); font-size: 14px; }
.offer-hidden { display: none; }
.offers-show-more {
    display: block;
    margin: 24px auto 0;
    min-width: 260px;
    cursor: pointer;
}
.offers-trust-note {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: #6b7280;
}
.offers-trust-links a { color: var(--accent-color); }

/* Offer table (MFO name + logo + personal-cabinet link) */
.offer-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border-color); border-radius: 14px; }
.offer-table { width: 100%; min-width: 420px; border-collapse: collapse; background: #ffffff; }
.offer-table th, .offer-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border-color); border-right: 1px solid var(--border-color); background: #ffffff; }
.offer-table th:last-child, .offer-table td:last-child { border-right: none; }
.offer-table th { font-weight: 700; color: var(--accent-color); background: color-mix(in srgb, var(--accent-color) 6%, transparent); }
.offer-table tr:last-child td { border-bottom: none; }
.offer-table-mfo { display: flex; align-items: center; gap: 12px; }
.offer-table-mfo img { width: 80px; height: 56px; object-fit: contain; flex-shrink: 0; }
.offer-table .btn { white-space: nowrap; }

@media (max-width: 1024px) {
    .credit-offer-card { flex: 1 1 calc(50% - 10px); min-width: 260px; }
}
@media (max-width: 640px) {
    .credit-offers { gap: 16px; }
    .credit-offer-card { flex: 1 1 100%; max-width: 100%; padding: 20px 16px; }
    .offer-logo { width: 170px; height: 110px; }
    .offer-header { min-height: 110px; }
}
