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

:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;

    --secondary-color: #198754;
    --secondary-hover: #157347;

    --background-light: #f8f9fa;
    --container-bg: #ffffff;

    --text-color: #212529;
    --heading-color: #1a2a4c;
    --label-color: #495057;

    --border-color: #dee2e6;
    --textarea-bg-readonly: #e9ecef;

    --white: #ffffff;
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6; 
    padding: 40px; 
    background-color: var(--background-light);
    color: var(--text-color);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
    background-color: var(--container-bg);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    text-align: left;
    margin-top: 0;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--label-color);
}

.tool-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.tool-column {
    flex: 1;
    min-width: 0;
}

#decoder-section h2 {
    border-color: var(--primary-color);
}

#encoder-section h2 {
    border-color: var(--secondary-color);
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-family: "Courier New", Courier, monospace;
    font-size: 1rem;
    margin-bottom: 10px;
    resize: vertical;
    transition: all 0.2s ease-in-out;
}

textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.25);
}

textarea[readonly] {
    background-color: var(--textarea-bg-readonly);
    cursor: default;
}

button {
    display: block;
    width: 100%;
    padding: 14px;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--white);
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.green-button {
    background-color: var(--secondary-color);
}

.green-button:hover {
    background-color: var(--secondary-hover);
}

/* Botões pequenos abaixo dos campos */
.text-actions {
    display: flex;
    gap: 10px;
    margin-top: -6px;
    margin-bottom: 15px;
}

.text-actions button {
    background: none;
    border: none;
    padding: 2px 4px;
    font-size: 0.85rem;
    color: var(--label-color);
    cursor: pointer;
    text-decoration: underline;
    width: auto;
    font-weight: normal;
    box-shadow: none;
}

.text-actions button:hover {
    color: var(--primary-color);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 992px) {
    .tool-wrapper {
        flex-direction: column;
        gap: 40px;
        align-items: stretch;
    }

    .tool-column {
        width: 100%;
    }

    h1 {
        font-size: 2.5rem;
        margin-bottom: 30px;
    }

    h2 {
        font-size: 1.6rem;
        text-align: center;
    }
}

@media (max-width: 768px) {
    body, .container {
        padding: 25px;
    }

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    button {
        font-size: 1rem;
        padding: 12px;
    }
}

@media (max-width: 576px) {
    body, .container {
        padding: 18px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    textarea {
        font-size: 1rem;
        min-height: 100px;
    }

    button {
        font-size: 1rem;
        padding: 12px;
    }
}