/* ===== Global Styles ===== */
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: #0e0f1c;
    color: #dfe7f5;
}

h1, h2, h3 {
    margin: 0;
    font-weight: 700;
    color: #f5f7fb;
}

p {
    margin: 0;
    line-height: 1.6;
}

a {
    color: inherit;
}

/* ===== Hero ===== */
.hero {
    background: radial-gradient(circle at 20% 20%, rgba(94, 215, 255, 0.24), transparent 38%),
                radial-gradient(circle at 80% 10%, rgba(255, 159, 94, 0.22), transparent 36%),
                linear-gradient(135deg, #15172b 0%, #0f1222 40%, #0a0c18 100%);
    padding: 62px 22px 54px;
    text-align: center;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.hero-inner {
    max-width: 1020px;
    margin: 0 auto;
    display: grid;
    gap: 16px;
}

.hero-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    text-align: left;
}

.hero-icon {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
    object-fit: cover;
}

.hero-text {
    max-width: 640px;
}

.hero h1 {
    font-size: clamp(2rem, 3vw + 1rem, 2.8rem);
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 1rem;
    color: #c7d3e8;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    background: #f5f7fb;
    color: #0f1222;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    width: max-content;
    justify-self: start;
    margin-left: 12px;
}

.back-button:hover {
    background: #e6ecff;
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
}

/* ===== Disclaimer ===== */
.disclaimer-banner {
    background: rgba(255, 159, 94, 0.18);
    border-top: 1px solid rgba(255, 159, 94, 0.45);
    border-bottom: 1px solid rgba(255, 159, 94, 0.45);
    color: #f9efe7;
    text-align: center;
    padding: 14px 18px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ===== Layout ===== */
.page-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 34px 20px 60px;
}

.seo-text {
    margin-top: 28px;
    color: #c7d3e8;
}

.seo-text h2,
.seo-text h3 {
    color: #f5f7fb;
}

.seo-text h3 {
    margin-top: 16px;
}

.seo-text p {
    margin-top: 10px;
}

.seo-text ul {
    margin: 10px 0 0 18px;
    padding: 0;
    line-height: 1.6;
}

.seo-text li {
    margin-bottom: 6px;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading h2 {
    font-size: 1.5rem;
}

.section-heading p {
    color: #aab8d4;
    margin-top: 4px;
}

.tools-section {
    margin-bottom: 40px;
}

.ad-slot {
    display: flex;
    justify-content: center;
    margin: 16px auto 20px;
}

.ad-slot-top {
    margin-top: 14px;
}

.ad-slot-mid {
    margin-bottom: 24px;
}

.ad-unit {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    text-decoration: none;
}

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

.ad-728x90 {
    width: 728px;
    height: 90px;
}

.ad-468x60 {
    width: 468px;
    height: 60px;
}

.ad-320x50 {
    width: 320px;
    height: 50px;
}

.ad-300x250 {
    width: 300px;
    height: 250px;
}

.ad-mobile {
    display: none;
}

@media (max-width: 768px) {
    .ad-desktop {
        display: none;
    }

    .ad-mobile {
        display: block;
    }

    .ad-slot {
        margin: 14px auto 18px;
    }
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.tool-card {
    display: block;
    padding: 18px 18px 16px;
    background: linear-gradient(145deg, rgba(94, 215, 255, 0.08), rgba(255, 159, 94, 0.06));
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
    border-color: rgba(94, 215, 255, 0.4);
}

.tool-card h3 {
    font-size: 1.08rem;
    margin-bottom: 6px;
}

.tool-card p {
    color: #c7d3e8;
    font-size: 0.97rem;
}

.tool-card.muted {
    background: rgba(255, 255, 255, 0.04);
    border-style: dashed;
    cursor: default;
}

.tool-card.muted:hover {
    transform: none;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ===== Forms & Inputs ===== */
.card {
    background: #121326;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.card-centered {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.card-centered h2,
.card-centered label,
.card-centered p {
    align-self: center;
    width: 100%;
    max-width: 360px;
}

.card-centered input,
.card-centered .result-grid,
.card-centered .table-wrap,
.card-centered button.primary {
    width: 100%;
    max-width: 360px;
}

.card-centered .result-grid {
    grid-template-columns: 1fr;
}

label {
    display: block;
    font-weight: 600;
    margin-top: 12px;
    margin-bottom: 6px;
}

input {
    width: 100%;
    max-width: 280px;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #0c0d1b;
    color: #dfe7f5;
    font-size: 0.95rem;
}

.card input[type="number"] {
    max-width: 200px;
}

input:focus {
    outline: 2px solid rgba(94, 215, 255, 0.6);
    border-color: rgba(94, 215, 255, 0.4);
}

button.primary {
    margin-top: 16px;
    padding: 12px 14px;
    width: 100%;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #5ed7ff, #ff9f5e);
    color: #0a0c18;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(94, 215, 255, 0.28);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(94, 215, 255, 0.32);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0 6px;
}

.result-card {
    background: #0f1122;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.result-label {
    color: #aab8d4;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.result-value {
    font-size: 1.3rem;
    font-weight: 700;
}

.table-wrap {
    margin-top: 18px;
    border-radius: 12px;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #0c0d1b;
    color: #dfe7f5;
}

th, td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: right;
    white-space: nowrap;
}

th:first-child,
td:first-child {
    text-align: left;
}

th {
    background: rgba(255, 255, 255, 0.04);
    font-weight: 700;
}

/* ===== Debt Planner ===== */
.inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 12px 0 4px;
}

.inputs-grid > div {
    min-width: 0;
}

.debt-list {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}

.debt-row {
    display: grid;
    grid-template-columns: minmax(160px, 1.1fr) minmax(100px, 0.9fr) minmax(110px, 0.9fr) minmax(110px, 0.9fr) auto;
    gap: 10px;
    align-items: center;
}

.debt-row input {
    width: 100%;
    min-width: 0;
    justify-self: start;
}

.debt-row .field-name {
    max-width: 240px;
}

.debt-row .field-rate {
    max-width: 110px;
}

.debt-row .field-min {
    min-width: 120px;
    justify-self: start;
}

.budget-row {
    grid-template-columns: minmax(180px, 1.4fr) minmax(90px, 0.7fr) minmax(130px, 0.9fr) auto;
}

.budget-row .field-name {
    max-width: 260px;
}

.budget-row .field-rate {
    max-width: 90px;
}

.budget-row .result-value {
    font-size: 1.05rem;
}

.btn-secondary {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #dfe7f5;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.btn-secondary:hover {
    transform: translateY(-1px);
    border-color: rgba(94, 215, 255, 0.5);
}

.payoff-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.payoff-card {
    background: #0f1122;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.payoff-card h3 {
    margin-bottom: 8px;
}

.payoff-card ol {
    margin: 0;
    padding-left: 18px;
    color: #c7d3e8;
}

@media (max-width: 720px) {
    .debt-row {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "name name"
            "balance rate"
            "min remove";
    }

    .debt-row .field-name { grid-area: name; }
    .debt-row .field-balance { grid-area: balance; }
    .debt-row .field-rate { grid-area: rate; }
    .debt-row .field-min { grid-area: min; justify-self: start; }
    .debt-row .field-remove { grid-area: remove; justify-self: end; }

    .budget-row {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "name name"
            "rate amount"
            "remove remove";
    }

    .budget-row .field-name { grid-area: name; }
    .budget-row .field-rate { grid-area: rate; }
    .budget-row .field-min { grid-area: amount; justify-self: start; }
    .budget-row .field-remove { grid-area: remove; justify-self: end; }
}

/* ===== Footer ===== */
footer {
    padding: 22px 16px 34px;
    background: #0a0c18;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    color: #9fb0ce;
    text-align: center;
    display: grid;
    gap: 10px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #c7d3e8;
    text-decoration: none;
    font-weight: 600;
}

.footer-links a:hover {
    color: #5ed7ff;
    text-decoration: underline;
}

.footer-note {
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .hero-icon {
        width: 72px;
        height: 72px;
    }
}
