:root {
    --primary: #d0c6ff;
    --primary-dark: #b8acff;
    --bg-main: #f8f3f3;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.6);
    --text-main: #1a1a1a;
    --text-muted: #6b7280;
    --border-color: rgba(0, 0, 0, 0.05);
    --border-glow: rgba(208, 198, 255, 0.3);
    
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-layered: 0 1px 2px 0 rgba(0, 0, 0, 0.05), 0 4px 6px 0 rgba(0, 0, 0, 0.02), 0 12px 24px 0 rgba(0, 0, 0, 0.03);
    
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

[data-theme="dark"] {
    --bg-main: #0a0a0a;
    --bg-card: rgba(22, 22, 22, 0.7);
    --bg-glass: rgba(22, 22, 22, 0.6);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(208, 198, 255, 0.15);
    
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-medium: 0 20px 50px rgba(0, 0, 0, 0.7);
    --shadow-layered: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1), 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.section-locked {
    opacity: 0.3 !important;
    filter: blur(4px) !important;
    pointer-events: none !important;
    user-select: none !important;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    font-size: 15px;
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 60px 20px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.main-wrapper {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.container {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 48px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-layered);
    width: 100%;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.config-card h2 {
    font-weight: 800;
    margin-bottom: 40px;
    font-size: 1.75rem;
    margin-top: 0;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

.section-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text-main);
}

.config-card h2.section-title {
    margin-bottom: 0;
    font-size: 1.2rem;
}

.dropdown-header .section-title {
    margin: 0;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

input[type="number"],
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    outline: none;
    transition: var(--transition);
    background: var(--bg-glass);
    color: var(--text-main);
    letter-spacing: -0.02em;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--border-glow);
    background: var(--bg-card);
}

/* Estilização dos Sliders */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 10px;
    margin-top: 20px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #ffffff;
    border: 2px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: var(--primary);
}

.value-display {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 12px;
}

/* Modalidade */
.modalidade-container {
    margin-top: 40px;
}

.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.radio-option {
    flex: 1;
    min-width: 150px;
}

.radio-option input {
    display: none;
}

.radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    height: 100%;
    transition: all 0.2s;
    margin: 0;
}

.radio-option input:checked+.radio-label {
    border-color: var(--nu-purple);
    background-color: var(--nu-purple);
    color: #ffffff;
    font-weight: 700;
}

[data-theme="dark"] .radio-option input:checked+.radio-label {
    background-color: var(--nu-purple-dark);
    color: #000000;
}

/* Results Area */
.results-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.metric-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 24px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
    border-color: var(--border-glow);
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    margin-top: 5px;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

.metric-value.blue {
    color: #d0c6ff;
}

.metric-value.orange {
    color: #f5b57d;
}

.metric-value.green {
    color: #15cece;
}

.metric-value.red {
    color: #e63946;
}

.summary-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    border-left: 4px solid #15cece;
    box-shadow: 0px 2px 8px var(--shadow-color);
}

.summary-title {
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.row-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.row-item.last {
    border-bottom: none;
}

.row-item-value {
    font-weight: 600;
}

.row-item-value.blue {
    color: #d0c6ff;
}

.row-item-value.red {
    color: #e63946;
}

.row-item-value.green {
    color: #15cece;
}

.row-item-value.orange {
    color: #e89854;
}

.chart-container,
.table-container {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 24px;
    box-shadow: 0 4px 20px var(--shadow-color);
}

.table-container {
    overflow-x: auto;
}

.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.info-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0px 2px 8px var(--shadow-color);
}

.info-card h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 700;
}

.info-card h4.mcmv {
    color: #15cece;
}

.info-card h4.sbpe {
    color: #e63946;
}

.info-card h4.avista {
    color: #f5b57d;
}

.info-card ul {
    padding-left: 20px;
    margin: 0;
    color: var(--nu-text-muted);
    font-size: 0.85rem;
}

.info-card ul li {
    margin-bottom: 10px;
}

/* Table Styles */
.minimalist-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
}

.minimalist-table th,
.minimalist-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.minimalist-table th {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-glass);
}

.minimalist-table td {
    color: var(--text-main);
    font-weight: 500;
}

.minimalist-table tr:hover td {
    background: rgba(208, 198, 255, 0.03);
}

/* Minimalist Dropdown Section */
.dropdown-minimalist {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    background: var(--bg-card);
    transition: background 0.2s;
}

.dropdown-header:hover {
    background: var(--border-light);
}

.dropdown-icon {
    font-size: 1.25rem;
    color: var(--nu-text-muted);
    transition: transform 0.3s ease;
}

.dropdown-content {
    display: none;
    padding: 0 25px 25px 25px;
    border-top: 1px solid var(--border-light);
    animation: slideDown 0.3s ease-out;
}

.dropdown-content p {
    font-size: 0.9rem;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Resumo da Operação Table */
.resumo-table {
    width: 100%;
    border-collapse: collapse;
}

.resumo-table tr {
    border-bottom: 1px solid var(--border-color);
}

.resumo-table tr:last-child {
    border-bottom: none;
}

.resumo-table td {
    padding: 15px 0;
    font-size: 0.95rem;
    color: var(--nu-text);
}

.resumo-table td:first-child {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resumo-table td:last-child {
    text-align: right;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--nu-text);
}

.detail-table {
    font-size: 0.95rem;
    table-layout: fixed;
}

.detail-table thead th {
    padding: 12px 8px;
    text-align: left;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
}

.detail-table tbody td {
    padding: 12px 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.detail-table td:first-child {
    display: table-cell;
    font-weight: 700;
    color: #d68100;
}

.detail-table td:last-child {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--nu-purple);
    border-radius: 50%;
    font-size: 0.7rem;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    color: var(--nu-purple);
    cursor: help;
}

/* Specific Rentabilidade cards spacing */
.dropdown-content .metrics-grid {
    margin-top: 25px !important;
    gap: 20px;
}

.dropdown-content .summary-container {
    margin-top: 25px;
}

.dropdown-content .chart-container,
.dropdown-content .table-container {
    margin-top: 25px;
    padding: 25px;
    box-shadow: none;
    border: 1px solid var(--border-light);
}

/* Airbnb Specific Styles */
.scenario-card:hover {
    transform: translateY(-5px);
    border-color: #3a86ff !important;
}

.scenario-card.active {
    border-color: #3a86ff !important;
    background: rgba(58, 134, 255, 0.05) !important;
}

.scenario-tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 15px;
}

@media (max-width: 800px) {
    .scenarios-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 800px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .info-cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    width: 95%;
    max-width: 1000px;
    max-height: 85vh;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 40px var(--shadow-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--nu-text);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--nu-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
    background: var(--border-light);
    color: var(--nu-text);
}

.modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.modal-body table.minimalist-table {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.modal-body table.minimalist-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-card);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.btn-detalhamento {
    display: block;
    width: 100%;
    background: rgba(208, 198, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-main);
    padding: 18px;
    border: 1.5px solid rgba(208, 198, 255, 0.3);
    border-radius: var(--border-radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    text-align: center;
    margin-top: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.btn-detalhamento:hover {
    background: rgba(208, 198, 255, 0.25);
    border-color: var(--primary);
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 12px 25px rgba(208, 198, 255, 0.2);
    color: var(--text-main);
}

.btn-detalhamento::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
}

.btn-detalhamento:hover::after {
    left: 100%;
}

.btn-pdf {
    background: transparent;
    color: var(--text-main);
    border: 2px solid var(--primary);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn-pdf:hover {
    background: var(--primary);
    color: #000;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 15px rgba(208, 198, 255, 0.4);
    border-color: var(--primary);
}

.btn-clear {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-clear:hover {
    color: var(--text-main);
    border-color: var(--primary);
    background: rgba(208, 198, 255, 0.12);
}

.btn-clear-block {
    width: 100%;
    margin-top: 0;
    padding: 10px 12px;
    text-align: center;
}

.input-group-clear {
    justify-content: flex-start;
    padding-top: 34px;
}

@media (max-width: 800px) {
    .input-group-clear {
        padding-top: 0;
    }

    .btn-clear-block {
        margin-top: 8px;
    }
}

[data-theme="dark"] .btn-pdf {
    border-color: var(--primary);
    color: var(--text-main);
}
[data-theme="dark"] .btn-pdf:hover {
    background: var(--primary);
    color: #000;
}

/* Toggle Switch Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--nu-purple);
}

[data-theme="dark"] input:checked + .slider {
    background-color: var(--nu-purple-dark);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--nu-purple);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Bank Cards Ineligible State */
.bank-card.inelegivel {
    opacity: 0.7;
    filter: grayscale(0.2);
    cursor: not-allowed;
}

.bank-card.inelegivel:hover {
    transform: none;
    box-shadow: none;
}

.inelegivel-reason {
    font-size: 0.75rem;
    color: #e63946;
    font-weight: 700;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

/* Recommended Badge */
.recommended-badge {
    background: var(--primary);
    color: #000;
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 50px;
    font-weight: 800;
    text-transform: uppercase;
    margin-left: 10px;
    vertical-align: middle;
}

/* Header Premium */
.main-header {
    text-align: center;
    margin-bottom: 56px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.bank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.bank-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 24px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bank-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary);
}

/* Efeito de Reflexo (Shimmer) */
.bank-card::after {
    content: "";
    position: absolute;
    top: -150%;
    left: -150%;
    width: 300%;
    height: 300%;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0) 45%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0) 55%
    );
    transition: all 0s;
    pointer-events: none;
    transform: rotate(25deg);
}

.bank-card:hover::after {
    left: 150%;
    top: 150%;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .bank-card::after {
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0) 45%,
        rgba(255, 255, 255, 0.03) 50%,
        rgba(255, 255, 255, 0) 55%
    );
}

.theme-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border-radius: 34px;
}

.theme-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .theme-slider {
    background-color: var(--primary);
}

input:checked + .theme-slider:before {
    transform: translateX(24px);
}

footer {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

footer p {
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.footer-dev {
    margin-top: 10px;
    font-size: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.footer-link {
    color: #15cece;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}

.footer-link:hover {
    text-decoration: underline;
    opacity: 0.9;
}

#rentabilidade-breakdown {
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-color);
}

.breakdown-item {
    transition: all 0.2s ease;
}

.breakdown-item:hover {
    background: rgba(148, 163, 184, 0.05);
    padding-left: 30px !important;
}

.breakdown-item span:last-child {
    font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
    #target-value-display {
        font-size: 2rem !important;
    }
    #patrimonio-headline h4 {
        font-size: 0.9rem !important;
    }
}

/* Bank Comparison Grid & Cards - Revolut Style */
.bank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 24px;
    padding-top: 10px;
}

.bank-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.bank-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary);
}

.bank-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.bank-logo img {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.bank-card-main {
    text-align: center;
    padding: 8px 0;
}

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

.main-parcela-value {
    font-size: 1.8rem !important;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -0.04em;
    line-height: 1;
    margin: 6px 0 0;
}

.bank-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: var(--bg-main);
    padding: 16px;
    border-radius: 12px;
    margin: 16px 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.stat-value {
    font-size: 0.92rem;
    font-weight: 700;
}

.stat-value strong {
    font-size: 0.92rem;
    font-weight: 700;
}

.bank-card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
}

.bank-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 40px 0 24px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    border-radius: var(--border-radius-md);
    transition: var(--transition);
}

.bank-section-header:hover {
    background: var(--bg-card);
    box-shadow: var(--shadow-soft);
}

.bank-section-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* Seção de Seleção de Cards */
.has-selection .bank-card:not(.selected) {
    opacity: 0.3;
    filter: blur(1.5px) grayscale(0.2);
    transform: scale(0.98);
}

.bank-card.selected {
    border-color: var(--primary);
    border-width: 2px;
    background: rgba(208, 198, 255, 0.05);
}

.bank-card.selected::before {
    content: "✓";
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary);
    color: #000;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 900;
}

.inelegivel-reason {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    background: #202020;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    z-index: 10;
}

/* Bank Tags - Minimalist Pills */
.bank-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    gap: 4px;
    line-height: 1;
    white-space: nowrap;
}

.bank-tag.tag-primary {
    background: var(--primary);
    color: #000;
}

.bank-tag.tag-index {
    background: var(--bg-main);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.bank-tag.tag-success {
    background: #10b981;
    color: #ffffff;
}

[data-theme="dark"] .bank-tag.tag-success {
    background: #059669;
    color: #ffffff;
}

/* Collapsed Sections */
.bank-section.collapsed .bank-grid {
    display: none;
}

.bank-section.collapsed .section-toggle-icon {
    transform: rotate(-90deg);
}

.section-toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Caixa Subgroup Styling */
.bank-subgroup-title {
    grid-column: 1 / -1;
    width: 100%;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    padding: 24px 0 8px;
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 8px;
}

/* Scrollbar Premium */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Glow Text */
.text-primary { color: var(--primary); }
.text-success { color: #10b981; }
.text-warning { color: #f59e0b; }
.text-danger  { color: #ef4444; }

/* Dashboard Widget Spacing */
.dropdown-minimalist {
    margin-top: 24px;
    box-shadow: var(--shadow-layered);
}

/* Logo Scaling & Proportions Fix */
.main-logo {
    max-height: 56px !important; /* Constraining the huge VPS logo */
    width: auto;
    object-fit: contain;
    margin-bottom: 20px;
    display: inline-block;
}

.bank-section-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 80px;
    margin-right: 12px;
    background: white; /* Contrast for logos */
    padding: 6px 12px;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.bank-section-logo img {
    max-height: 28px !important;
    max-width: 100%;
    width: auto;
    object-fit: contain;
}

[data-theme="dark"] .bank-section-logo {
    background: rgba(255, 255, 255, 0.9); /* Keep logos legible in dark mode */
}

/* --- Finishing Touches --- */

/* Back to Top Button */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: #000;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
    border: none;
    font-size: 1.25rem;
}

#backToTop:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Age Legend Alignment */
#idadeLegenda {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    padding: 4px 12px;
    background: rgba(208, 198, 255, 0.1);
    border-radius: 20px;
    width: fit-content;
}

/* Highlight for Tables */
.highlight-column {
    background: rgba(21, 206, 206, 0.05) !important;
    font-weight: 800 !important;
    color: #15cece !important;
}

/* Airbnb Warning Box Enhancement */
#airbnbWarning {
    background: rgba(230, 57, 70, 0.1) !important;
    border: 1px solid rgba(230, 57, 70, 0.3) !important;
    font-weight: 500;
}

[data-theme="dark"] #airbnbWarning {
    color: #ff5f6d !important; /* Brighter for Dark Mode */
    background: rgba(230, 57, 70, 0.15) !important;
}

/* Utilities */
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.p-24 { padding: 24px; }
.gap-10 { gap: 10px; }

.recommended-badge {
    margin-left: 12px !important;
    padding: 4px 10px !important;
    background: #15cece !important;
    color: #fff !important;
    font-size: 0.7rem !important;
    border-radius: 8px !important;
}
