:root {
    --bg-color: #02040a;
    --card-bg: rgba(13, 20, 34, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.5);
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --gradient-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    padding: 1.5rem;
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Luxury Background */
.mesh-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(2, 4, 10, 1) 0%, rgba(2, 4, 10, 1) 100%);
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3%3Ffilter id='n'%3E%3FfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3'/%3E%3F/filter%3E%3Frect width='100%25' height='100%25' filter='url(%23n)'/%3E%3F/svg%3E");
}

/* Layout */
.container {
    max-width: 1240px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span { color: var(--accent-blue); -webkit-text-fill-color: var(--accent-blue); }

/* Dashboard Grid - ALIGNMENT FIX */
.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr 380px;
    gap: 2rem; /* Aumentado para melhor respiro */
    align-items: stretch;
    flex: 1;
}

/* Card Styling (Glass) */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    padding: 1.75rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    height: 100%; /* Ocupa altura total do container grid */
    display: flex;
    flex-direction: column;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-surface);
    pointer-events: none;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.card-unit {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 0.25rem;
}

/* Sidebar Params */
.sidebar-params {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.param-info-card {
    padding: 1.25rem;
    height: auto !important; /* Cards individuais não precisam stretch total */
}

.indicator-header {
    margin-bottom: 0.5rem;
}

.indicator-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent-blue);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px var(--accent-blue-glow);
}

.btn {
    width: 100%;
    padding: 1rem;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: auto; /* Empurra botão para o fim do card se flex */
}

.btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.4);
}

/* Result Design */
.result-card {
    border-color: rgba(59, 130, 246, 0.2);
}

.result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.price-main {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0.5rem 0;
    color: #fff;
}

.breakdown-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 1rem;
    padding: 1.25rem;
    flex: 1;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.breakdown-item:last-child { border: none; }

.label-sub { font-size: 0.8rem; color: var(--text-secondary); }
.val-sub { font-weight: 600; font-size: 0.9rem; }

.profit-highlight {
    margin-top: 1rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 1rem;
    border-radius: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profit-highlight span:first-child { color: var(--accent-green); font-weight: 700; font-size: 0.85rem; }
.profit-highlight span:last-child { color: var(--accent-green); font-weight: 800; font-size: 1rem; }

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

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

.modal-inner {
    width: 90%;
    max-width: 500px;
    transform: translateY(20px);
    transition: var(--transition);
}

.modal.active .modal-inner {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.params-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Animations */
.calculate-anim {
    animation: pulseGlow 0.5s ease-out;
}

@keyframes pulseGlow {
    0% { transform: scale(1); }
    50% { transform: scale(1.01); box-shadow: 0 0 20px rgba(59, 130, 246, 0.2); }
    100% { transform: scale(1); }
}

/* Responsiveness */
@media (max-width: 1100px) {
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .sidebar-params { grid-column: span 2; }
    .sidebar-params .card { height: auto; }
}

@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .sidebar-params { grid-column: auto; }
    .header { flex-direction: column; gap: 1rem; text-align: center; }
}
