:root {
    --bg-color: #000000;
    /* Pure Black */
    --card-bg: #000000;
    /* Pure Black */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(148, 163, 184, 0.2);
    --glow-color: rgba(59, 130, 246, 0.5);
    --font-main: 'Outfit', sans-serif;
    --highlight-color: #10b981;
    /* Emerald for good news/money */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: block;
    /* Removed flex */
    /* justify-content: center; Removed */
    /* align-items: center; Removed */
    overflow-x: hidden;
    position: relative;
}

.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    display: none;
    /* Hide blobs for pure black background */
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.blob-1 {
    top: 10%;
    left: 10%;
    width: 400px;
    height: 400px;
    background: #7c3aed;
    animation-delay: 0s;
}

.blob-2 {
    bottom: 20%;
    right: 10%;
    width: 300px;
    height: 300px;
    background: #2563eb;
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: #ec4899;
    animation-delay: -10s;
}

@keyframes move {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, -30px) scale(1.1);
    }
}

.container {
    width: 100%;
    /* max-width: 480px; Removed restriction on container to allow header flow */
    padding: 10px;
    z-index: 10;
    margin: 0 auto;
}

.calculator-card {
    width: 100%;
    max-width: 1000px;
    /* Widened to match reference */
    margin: 0 auto;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    /* Increased padding */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

/* Grid Layout for Inputs */
.input-grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .input-grid-container {
        grid-template-columns: 1fr 1fr;
    }
}

/* Grid Layout for Traffic Light / Results */
.result-grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .result-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.calculator-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-header {
    text-align: center;
    margin-bottom: 20px;
}

.card-header h1 {
    font-size: 1.5rem;
    /* Increased font */
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    /* Increased */
}

.attribution {
    margin-top: 15px;
    text-align: center;
}

.attribution p {
    font-size: 0.9rem;
    color: var(--highlight-color);
    font-weight: 500;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-icons a {
    display: inline-block;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.social-icons img {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.social-icons a:hover {
    transform: translateY(-3px);
}

.input-group {
    margin-bottom: 20px;
    /* Increased */
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    /* Increased */
    font-size: 0.9rem;
    /* Increased */
    font-weight: 600;
    color: var(--text-main);
}

.label-note {
    font-size: 0.45rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 12px 12px 12px 30px;
    /* Increased padding */
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    /* Standard font size */
    font-family: var(--font-main);
    transition: all 0.2s;
    outline: none;
}

input[type="number"]:focus,
input[type="text"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.helper-text {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.result-section {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    padding: 10px;
    margin-bottom: 16px;
    margin-top: 5px;
}

.traffic-light-section {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.section-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
}

.section-subtitle {
    font-size: 0.65rem;
    /* Reduced from 0.7rem */
    color: var(--text-muted);
    text-align: center;
    margin-top: -5px;
    margin-bottom: 20px;
    font-weight: 400;
    opacity: 0.9;
}

.traffic-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 6px 8px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.02);
    transition: background-color 0.2s;
}

.traffic-row:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.traffic-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    margin: 0;
    cursor: pointer;
    position: relative;
    outline: none;
    flex-shrink: 0;
    /* Prevent squeezing on mobile */
}

input[type="radio"]:checked {
    border-color: var(--primary-color);
}

input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.traffic-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.light-text {
    font-size: 0.65rem;
    /* Reduced from 0.75rem */
    color: var(--text-muted);
    transition: color 0.2s;
}

input[type="radio"]:checked+.traffic-label .light-text {
    color: #fff;
    font-weight: 600;
}

.light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    /* Prevent squeezing */
}

.green-light {
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.yellow-light {
    background-color: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

.red-light {
    background-color: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

.sub-value {
    font-size: 0.9rem;
    /* Reduced from 0.95rem */
    font-weight: 500;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.result-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.result-value.highlight {
    color: #60a5fa;
}

.result-value.total-value {
    font-size: 1rem;
    color: var(--highlight-color);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.total-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.actions {
    display: flex;
    justify-content: center;
}

.primary-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    display: block;
    width: 100%;
    padding: 16px;
    margin-top: 16px;
    background: transparent;
    border: 1px solid #ffffff;
    color: #ffffff;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Hide spin buttons for input number */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

@media (max-width: 480px) {
    .calculator-card {
        padding: 30px 20px;
    }

    .card-header h1 {
        font-size: 1.75rem;
    }
}

.breakdown-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.breakdown-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
}

.breakdown-row {
    margin-bottom: 8px !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

.breakdown-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breakdown-label .label-note {
    display: block;
    margin-left: 0;
    margin-top: 2px;
    opacity: 0.8;
}

.breakdown-value {
    font-size: 1.1rem;
    color: #e2e8f0;
    /* Slightly less bright than main results */
    /* Slightly less bright than main results */
    font-weight: 500;
}

.warning-tip {
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(245, 158, 11, 0.1);
    /* Low opacity yellow background */
    border: 1px solid rgba(245, 158, 11, 0.3);
    /* Yellow border */
    border-radius: 8px;
    color: #ffd166;
    /* Readable yellow text */
    font-size: 0.6rem;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
}

.credit-note {
    font-size: 0.6rem;
    /* Matches the small warning size */
    color: var(--text-muted);
    margin-top: -8px;
    /* Pull it up closer to the row */
    margin-bottom: 12px;
    text-align: right;
    /* Align with the values, or maybe just right? */
    font-style: italic;
    opacity: 0.8;
}

.version-text {
    font-size: 0.4rem;
    /* Smaller size */
    color: var(--text-muted);
    text-align: right;
    /* Right aligned */
    margin-top: 20px;
    opacity: 0.6;
}

/* Breath Animation for CTA Card */
@keyframes breath {
    0% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.2);
        border-color: rgba(16, 185, 129, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
        border-color: rgba(16, 185, 129, 0.8);
    }

    100% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.2);
        border-color: rgba(16, 185, 129, 0.3);
    }
}

/* Highlight Card Base Styles */
.highlight-card {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-top: 10px;
    margin-bottom: 10px;
    animation: breath 3s infinite ease-in-out;
    cursor: pointer;
    transition: transform 0.2s;

    /* FORCE Column Layout */
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center;
    gap: 8px;
}

/* ... other styles ... */

@media (max-width: 768px) {
    /* Increased breakpoint to catch larger phones */

    /* Traffic light section mobile tweaks */
    .traffic-row {
        align-items: center;
        padding: 6px 8px;
    }

    .section-subtitle {
        font-size: 0.45rem;
        /* Aggressively reduced */
        margin-bottom: 12px;
    }

    .light-text {
        font-size: 0.5rem;
        /* Aggressively reduced */
        line-height: 1.1;
    }

    .sub-value {
        font-size: 0.65rem;
        /* Aggressively reduced */
    }

    /* Highlight Card (Busca Casas) Mobile Layout */
    .highlight-card {
        padding: 20px 10px;
    }

    .highlight-card .result-label {
        font-size: 0.75rem;
        white-space: normal;
        width: 100%;
        margin-bottom: 5px;
        display: block;
        text-align: center;
        /* Explicitly center */
    }

    .highlight-card .result-value {
        margin-left: 0;
        font-size: 1.5rem;
        width: 100%;
        display: block;
        text-align: center;
        /* Explicitly center */
    }
}

/* FAQ Section */
.faq-section {
    margin-top: 3rem;
    margin-bottom: 2rem;
    width: 100%;
}

.faq-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.accordion-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-item:hover {
    border-color: #FFD700;
}

.accordion-header {
    width: 100%;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent !important;
    background-color: transparent !important;
    border: none;
    color: var(--text-main) !important;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    border-radius: 0;
}




.accordion-header .icon {
    font-size: 1.5rem;
    color: #FFD700;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s ease-in-out;
    background: rgba(15, 23, 42, 0.4);
}

.accordion-item.active .accordion-content {
    max-height: 1000px;
    /* Large enough to fit content */
    opacity: 1;
}

.accordion-content p {
    padding: 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
    text-align: right;
    /* Align with the values, or maybe just right? */
    font-style: italic;
    opacity: 0.8;
}

.version-text {
    font-size: 0.4rem;
    /* Smaller size */
    color: var(--text-muted);
    text-align: right;
    /* Right aligned */
    margin-top: 20px;
    opacity: 0.6;
}

/* Breath Animation for CTA Card */
@keyframes breath {
    0% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.2);
        border-color: rgba(16, 185, 129, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
        border-color: rgba(16, 185, 129, 0.8);
    }

    100% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.2);
        border-color: rgba(16, 185, 129, 0.3);
    }
}

/* Highlight Card Base Styles */
.highlight-card {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-top: 10px;
    margin-bottom: 10px;
    animation: breath 3s infinite ease-in-out;
    cursor: pointer;
    transition: transform 0.2s;

    /* FORCE Column Layout */
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center;
    gap: 8px;
}

/* ... other styles ... */

@media (max-width: 768px) {
    /* Increased breakpoint to catch larger phones */

    /* Traffic light section mobile tweaks */
    .traffic-row {
        align-items: center;
        padding: 6px 8px;
    }

    .section-subtitle {
        font-size: 0.45rem;
        /* Aggressively reduced */
        margin-bottom: 12px;
    }

    .light-text {
        font-size: 0.5rem;
        /* Aggressively reduced */
        line-height: 1.1;
    }

    .sub-value {
        font-size: 0.65rem;
        /* Aggressively reduced */
    }

    /* Highlight Card (Busca Casas) Mobile Layout */
    .highlight-card {
        padding: 20px 10px;
    }

    .highlight-card .result-label {
        font-size: 0.75rem;
        white-space: normal;
        width: 100%;
        margin-bottom: 5px;
        display: block;
        text-align: center;
        /* Explicitly center */
    }

    .highlight-card .result-value {
        margin-left: 0;
        font-size: 1.5rem;
        width: 100%;
        display: block;
        text-align: center;
        /* Explicitly center */
    }
}

/* FAQ Section */
.faq-section {
    margin-top: 3rem;
    margin-bottom: 2rem;
    width: 100%;
}

.faq-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.accordion-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-item:hover {
    border-color: #FFD700;
}

.accordion-header {
    width: 100%;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent !important;
    background-color: transparent !important;
    border: none;
    color: var(--text-main) !important;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    border-radius: 0;
}




.accordion-header .icon {
    font-size: 1.5rem;
    color: #FFD700;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s ease-in-out;
    background: rgba(15, 23, 42, 0.4);
}

.accordion-item.active .accordion-content {
    max-height: 1000px;
    /* Large enough to fit content */
    opacity: 1;
}

.accordion-content p {
    padding: 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0;
}

.accordion-item.active .accordion-header .icon {
    transform: rotate(45deg);
}

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 2px 2px 15px rgba(37, 211, 102, 0.6);
}

.whatsapp-float img {
    width: 35px;
    height: 35px;
    filter: brightness(0) invert(1);
    /* Make the SVG white */
}

@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-float img {
        width: 28px;
        height: 28px;
    }
}

/* Forced Nav Link Animation - Final Fix */
.nav-link-animated {
    position: relative !important;
    display: inline-flex !important;
    align-items: center;
    text-decoration: none !important;
}

.nav-link-animated::after {
    content: '' !important;
    position: absolute !important;
    width: 0 !important;
    height: 3px !important;
    bottom: 0px !important;
    left: 0 !important;
    background-color: #fbbf24 !important;
    /* Gold */
    transition: width 0.3s ease-out !important;
    border-radius: 2px;
}

.nav-link-animated:hover::after {
    width: 100% !important;
}

/* Forced FAQ Section Width - Final Fix */
.faq-section {
    width: 100% !important;
    max-width: 1000px !important;
    margin: 50px auto !important;
    padding: 0 10px !important;
}

.accordion-item {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
}