* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
    color: #333;
    padding: 15px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px 15px;
}

header h1 {
    font-size: 2rem;
    background: linear-gradient(90deg, #e94560, #c73e54);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

header p {
    color: #666;
    font-size: 1rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #e94560;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 14px;
    color: #e94560;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0e0e0;
}

/* Form */
.form-group {
    margin-bottom: 0;
}

.form-row + .form-row,
.form-group + .form-group {
    margin-top: 10px;
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.form-row .form-group {
    display: flex;
    flex-direction: column;
}

.form-row label {
    min-height: 2em;
    line-height: 1.2;
}

.half {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    color: #666;
    font-weight: 500;
}

input[type="number"],
input[type="text"],
select,
textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #fafafa;
    color: #333;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #e94560;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

input[readonly] {
    background: #e8e8e8;
    cursor: default;
    color: #333;
    font-weight: 600;
}

input.highlight-result[readonly] {
    background: #e3f2fd;
    color: #0d47a1;
    border-color: #90caf9;
}

input.highlight-blue[readonly] {
    background: #e8eaf6;
    color: #1a237e;
    border-color: #9fa8da;
}

input.highlight-green[readonly] {
    background: #e8f5e9;
    color: #1b5e20;
    border-color: #a5d6a7;
}

.section-divider {
    border: 0;
    border-top: 1px solid #e0e0e0;
    margin: 14px 0;
}

/* Checkbox */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #e94560;
    flex-shrink: 0;
}

.form-checkbox label {
    margin: 0;
    cursor: pointer;
    font-size: 0.85rem;
}

/* Hint / Link hint */
.link-hint {
    font-size: 0.78rem;
    color: #888;
}

.link-hint a {
    color: #e94560;
    text-decoration: underline;
}

/* Radio group */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-group.compact {
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s;
    font-size: 0.85rem;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    flex: 1;
    justify-content: center;
}

.radio-label:hover {
    background: rgba(233, 69, 96, 0.05);
}

.radio-label input {
    width: 16px;
    height: 16px;
    accent-color: #e94560;
}

/* Info card */
.info-card {
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    border: 1px solid #ffe0e0;
}

.full-width {
    grid-column: 1 / -1;
}

/* Spacing utilities */
.mt-0 { margin-top: 0; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 12px; }
.mt-lg { margin-top: 16px; }

.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 12px; }

/* Chart */
.chart-wrap {
    max-width: 320px;
    margin: 0 auto;
}

canvas#priceChart {
    max-height: 300px;
}

/* Results section */
.results {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid #e94560;
    margin-top: 16px;
}

.results h2 {
    text-align: center;
    margin-bottom: 16px;
    color: #333;
    font-size: 1.3rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.result-item {
    background: #fff;
    padding: 14px 10px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e8e8e8;
    transition: all 0.2s ease;
}

.result-item:hover {
    background: #fafafa;
    transform: scale(1.02);
}

.result-item.highlight {
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    border-color: #e94560;
    border-width: 2px;
}

.result-item span {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 4px;
}

.result-item strong {
    display: block;
    font-size: 1.1rem;
    color: #333;
}

.result-item.highlight strong {
    color: #e94560;
    font-size: 1.3rem;
}

/* Alertas */
.alertas-box,
.comparativo-box {
    margin-top: 12px;
    font-size: 0.9rem;
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.alert:last-child {
    margin-bottom: 0;
}

.alert-success {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}

.alert-warning {
    background: #fff8e1;
    color: #7c4a00;
    border: 1px solid #ffe082;
}

.alert-danger {
    background: #ffebee;
    color: #7f0000;
    border: 1px solid #ef9a9a;
}

.alert-info {
    background: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #90caf9;
}

/* Buttons */
.btn-group {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-group .btn-primary {
    flex: 1;
    min-width: 120px;
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #e94560, #c73e54);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(233, 69, 96, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary.btn-secondary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.btn-pdf {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

.btn-reset {
    background: linear-gradient(135deg, #9ca3af, #6b7280) !important;
}

/* Textarea resumo */
.res-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    background: #fafafa;
    color: #333;
}

/* Tabela */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table td {
    color: #333;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 24px;
    padding: 16px;
    color: #888;
    font-size: 0.85rem;
}

footer a {
    color: #e94560;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.footer-note {
    font-size: 0.85rem;
    color: #888;
    margin-top: 4px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #323232;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Responsivo */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-row {
        flex-direction: row;
        gap: 8px;
    }

    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card {
        padding: 14px;
    }

    .btn-group {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.25rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .radio-label {
        font-size: 0.8rem;
        padding: 5px 8px;
    }
}
