/* SIMULADOR DE BENEFÍCIO FISCAL - ESTILOS CSS */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #004987 0%, #003366 100%);
    min-height: 100vh;
    padding: 30px 20px;
}

@media (max-width: 768px) {
    body {
        padding: 15px 10px;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .card {
        padding: 20px 15px;
        border-radius: 8px;
    }
}

h1 {
    color: #004987;
    margin-bottom: 10px;
    font-size: 1.8em;
    text-align: center;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.4em;
    }
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 0.9em;
}

h2 {
    color: #004987;
    margin-top: 30px;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 2px solid #004987;
    padding-bottom: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 1.27em;
}

@media (max-width: 768px) {
    label {
        font-size: 1.05em;
    }
}

.info-icon {
    color: #004987;
    cursor: help;
    font-weight: bold;
}

input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

@media (max-width: 768px) {
    input {
        padding: 10px;
        font-size: 16px;
    }
}

input:focus {
    outline: none;
    border-color: #004987;
}

button {
    background: linear-gradient(135deg, #004987 0%, #003366 100%);
    color: white;
    padding: 14px 40px;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    grid-column: 1 / -1;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 73, 135, 0.4);
}

.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #856404;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.alert-warning .icon {
    font-weight: bold;
    font-size: 1.2em;
    flex-shrink: 0;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #155724;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

@media (max-width: 768px) {
    table {
        font-size: 0.9em;
        margin: 15px 0;
    }

    th {
        padding: 10px 8px;
        font-size: 0.85em;
    }

    td {
        padding: 10px 8px;
    }

    .value-cell {
        font-size: 0.9em;
    }

    .label-cell {
        font-size: 0.9em;
    }

    /* Fazer a linha de Economia expandir em mobile - apenas o texto */
    .economia-row .label-cell {
        display: block;
        width: calc(100% - 20px);
        white-space: normal;
        word-wrap: break-word;
    }
}

th {
    background: #004987;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

tr:hover {
    background: #f5f5f5;
}

tr:last-child td {
    border-bottom: none;
}

.value-cell {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #333;
}

.label-cell {
    color: #555;
    font-weight: 500;
}

.base-row {
    background: #f9f9f9;
}

.ir-devido-row {
    background: #d4edda;
    color: #155724;
    font-weight: bold;
}

.ir-devido-row .value-cell {
    color: #155724;
}

.economia-row {
    background: #fff3cd;
    color: #856404;
    font-weight: bold;
}

.economia-row .value-cell {
    color: #856404;
}

.restituicao-row {
    background: #fff3cd;
    color: #856404;
    font-weight: bold;
}

.restituicao-row .value-cell {
    color: #856404;
}

.tabela-titulo {
    background: #004987;
    color: white;
    padding: 12px 15px;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
    margin-top: 30px;
}

.column-header {
    width: 25%;
    text-align: right;
}

.column-header:first-child {
    width: 25%;
    text-align: left;
}

footer {
    text-align: center;
    color: white;
    margin-top: 30px;
    font-size: 0.85em;
}

small {
    display: block;
    color: #999;
    margin-top: 4px;
}

.beneficio-button {
    background: #004987;
    color: #fff;
    border: none;
    padding: 12px 26px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.beneficio-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 73, 135, 0.4);
}

.beneficio-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1000;
}

.beneficio-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.beneficio-modal__content {
    background: #fff;
    border-radius: 16px;
    padding: 30px 24px;
    max-width: 750px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    max-height: 80vh;
    overflow-y: auto;
    padding-top: 50px;
}

.beneficio-modal__close {
    position: fixed;
    top: calc(50% - 180px);
    right: calc((100% - 750px) / 2 - 30px);
    background: #d32f2f;
    border: none;
    font-size: 1.8rem;
    color: #fff;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease;
}

.beneficio-modal__close:hover {
    background: #b71c1c;
}

.beneficio-modal__image {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin: 0 auto 20px;
    display: block;
}

.beneficio-modal__text {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

.beneficio-modal__pix-section {
    margin: 20px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    text-align: center;
}

.beneficio-modal__pix-section p {
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #333;
}

.beneficio-modal__pix-code {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #333;
    word-break: break-all;
    user-select: all;
}

.beneficio-modal__copy-button {
    background: #004987;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.beneficio-modal__copy-button:hover {
    opacity: 0.9;
}

.beneficio-modal__contact {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.6;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    text-align: center;
}

/* Tooltip Styles */
.info-icon {
    position: relative;
    cursor: help;
    color: #004987;
    font-weight: bold;
}

.info-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    white-space: normal;
    max-width: 320px;
    width: 320px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    font-weight: normal;
    line-height: 1.4;
    text-align: left;
}

.info-icon::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.info-icon:hover::after,
.info-icon:hover::before {
    opacity: 1;
}

@media (max-width: 1024px) {
    .info-icon::after {
        font-size: 14px;
        max-width: 320px;
        padding: 8px 12px;
    }
}

@media (max-width: 768px) {
    .info-icon::after {
        white-space: normal;
        max-width: 300px;
        width: 300px;
        bottom: auto;
        top: 100%;
        margin-top: 8px;
        font-size: 13px;
        padding: 10px 12px;
    }

    .info-icon::before {
        bottom: auto;
        top: 95%;
    }
}
