/* --- Fuentes y Variables Globales (Tus Estilos Originales) --- */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css');


:root {
    --primary-color: #4f46e5;
    --text-color-dark: #111827;
    --text-color-light: #6b7280;
    --background-color: #f6f7fb; /* Tu color de fondo */
    --card-background: #ffffff;
    --border-color: #e5e7eb;
    --font-sans: 'IBM Plex Sans', sans-serif;
    --success-color: #10b981;
    --hover-color: #4338ca; /* Un poco más oscuro que el primario */
}

/* --- Estilos Generales y Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background-color);
    color: var(--text-color-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    justify-content: center; /* Centra el contenido principal */
    align-items: center; /* Centra verticalmente si hay espacio */
    padding: 2rem;
}

/* --- Header, Footer, Hero y otras secciones (Tus Estilos Originales) --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

header, footer {
    background: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}
footer {
    border-bottom: none;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}
.header-container, .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo { font-size: 1.5rem; font-weight: 700; color: var(--text-color-dark); text-decoration: none; }
.nav-links, .footer-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a, .footer-links a { color: var(--text-color-light); text-decoration: none; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover, .footer-links a:hover { color: var(--primary-color); }
.footer-container { text-align: center; flex-direction: column; }
.footer-links { justify-content: center; margin-bottom: 1rem; flex-wrap: wrap; }
.copyright { color: var(--text-color-light); font-size: 0.875rem; }

/* === SECCIÓN DE LA HERRAMIENTA (REDISEÑADA PARA COINCIDIR CON LA IMAGEN) === */

.tool-card {
    width: 100%;
    max-width: 1000px; /* Ancho máximo de la tarjeta */
    background-color: var(--card-background);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Contenedor de las dos cajas de texto */
.tool-io-container {
    display: flex;
    gap: 20px;
}

/* Estilo para cada columna (Input y Output) */
.io-column {
    flex: 1; /* Cada columna ocupa el 50% */
    display: flex;
    flex-direction: column;
    gap: 8px; /* Espacio entre la cabecera y el textarea */
}

/* Cabecera de cada columna (contador + botón de icono) */
.io-header {
    display: flex;
    justify-content: flex-end; /* Alinea los ítems a la derecha */
    align-items: center;
    gap: 12px;
    height: 24px;
}

.char-count {
    font-size: 0.875rem;
    color: var(--text-color-light);
    font-weight: 500;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-color-light);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s, background-color 0.2s;
}

.btn-icon:hover {
    color: var(--text-color-dark);
    background-color: #f3f4f6;
}

/* Áreas de texto */
.text-area {
    width: 100%;
    height: 300px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 1rem;
    resize: none; /* Evita que el usuario cambie el tamaño */
    transition: border-color 0.2s, box-shadow 0.2s;
}

.text-area:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Controles inferiores (radios y botón principal) */
.tool-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 16px;
}

/* Grupo de Radio Buttons */
.radio-group {
    display: flex;
    gap: 24px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Estilo personalizado para los radio buttons */
.radio-group input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
    top: -1px; /* Ajuste vertical fino */
}
.radio-group input[type="radio"]:checked {
    border-color: var(--primary-color);
}
.radio-group input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

/* Botón principal */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    background-color: var(--hover-color);
    box-shadow: 0 4px 10px -2px rgba(79, 70, 229, 0.3);
}

.btn-primary.success {
    background-color: var(--success-color);
}


/* === DISEÑO RESPONSIVO === */
@media (max-width: 768px) {
    main {
        padding: 1rem;
        align-items: flex-start;
    }
    .header-container { flex-direction: column; gap: 1rem; }
    .nav-links { gap: 1rem; }
    
    .tool-io-container {
        flex-direction: column;
    }
    
    .text-area {
        height: 200px;
    }

    .tool-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .footer-links { flex-direction: column; gap: 1rem; }
}
/* Instructions Section */
.instructions {
    width: 100%;
    max-width: 1000px; /* Ancho máximo de la tarjeta */
    background: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.instructions h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color-dark);
}

.instructions-list {
    list-style: none;
    counter-reset: step-counter;
}

.instructions-list li {
    counter-increment: step-counter;
    margin-bottom: 1.5rem;
    padding-left: 3rem;
    position: relative;
}

.instructions-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: var(--primary-color);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}