/* VARIABLES GLOBALES */
:root {
    --color-primario: #667eea;
    --color-secundario: #764ba2;
    --color-fondo: #f8f9fa;
    --color-texto: #333;
    --color-borde: #ddd;
    --color-exito: #10b981;
    --color-alerta: #f59e0b;
    --sombra: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-fondo);
    color: var(--color-texto);
    line-height: 1.6;
}

.contenedor {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

/* CABECERA */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--color-primario), var(--color-secundario));
    color: white;
    border-radius: 15px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitulo {
    font-size: 1.1em;
    opacity: 0.9;
}

/* BOTONES SELECTOR */
.selector-tipo {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.btn-tipo {
    padding: 12px 25px;
    border: 2px solid var(--color-primario);
    background: white;
    color: var(--color-primario);
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 1em;
}

.btn-tipo:hover {
    transform: translateY(-3px);
    box-shadow: var(--sombra);
}

.btn-tipo.activo {
    background: var(--color-primario);
    color: white;
}

/* SECCIONES */
.generador {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--sombra);
    margin-bottom: 30px;
    display: none;
}

.generador.activo {
    display: block;
}

.generador h2 {
    color: var(--color-primario);
    margin-bottom: 10px;
    font-size: 1.8em;
}

.descripcion {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
}

/* OPCIONES */
.opciones {
    background: #f0f4ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.opciones label {
    display: block;
    margin: 10px 0;
    cursor: pointer;
    user-select: none;
}

.opciones input[type="checkbox"],
.opciones input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

/* CONTROL DE LONGITUD */
.longitud {
    margin-bottom: 20px;
    background: #f0f4ff;
    padding: 15px;
    border-radius: 8px;
}

.longitud label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

#longitud-password {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

#longitud-password::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primario);
    cursor: pointer;
}

#longitud-password::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primario);
    cursor: pointer;
    border: none;
}

#valor-longitud {
    font-weight: bold;
    color: var(--color-primario);
}

/* BOTONES */
.btn-generar,
.btn-actualizar {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--color-primario), var(--color-secundario));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.btn-generar:hover,
.btn-actualizar:hover {
    transform: translateY(-2px);
    box-shadow: var(--sombra);
}

.btn-generar:active,
.btn-actualizar:active {
    transform: translateY(0);
}

.btn-actualizar {
    margin-bottom: 15px;
    background: var(--color-alerta);
}

/* RESULTADO */
.resultado {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#resultado-password,
#resultado-email {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--color-borde);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1em;
    background: #f9f9f9;
    color: var(--color-texto);
}

.btn-copiar {
    padding: 12px 20px;
    background: var(--color-exito);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.btn-copiar:hover {
    transform: scale(1.05);
    box-shadow: var(--sombra);
}

/* BANDEJA DE ENTRADA */
.bandeja-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--color-borde);
}

.bandeja-info h3 {
    margin-bottom: 15px;
    color: var(--color-primario);
}

.lista-emails {
    background: #f9f9f9;
    border: 1px solid var(--color-borde);
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.email-item {
    padding: 12px;
    border-bottom: 1px solid var(--color-borde);
    cursor: pointer;
    transition: background 0.2s;
}

.email-item:last-child {
    border-bottom: none;
}

.email-item:hover {
    background: #f0f4ff;
}

.email-from {
    font-weight: bold;
    color: var(--color-primario);
    margin-bottom: 5px;
}

.email-asunto {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 5px;
}

.email-fecha {
    font-size: 0.85em;
    color: #999;
}

.texto-vacio {
    text-align: center;
    color: #999;
    padding: 20px;
}

.email-contenido {
    background: #f0f4ff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.95em;
    line-height: 1.5;
    word-wrap: break-word;
}

/* INFO */
.info-contraseña,
.info-email {
    background: #fef3c7;
    border-left: 4px solid var(--color-alerta);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 0.95em;
}

.info-contraseña p,
.info-email p {
    margin: 0;
}

/* PUBLICIDAD */
.publicidad-espacio {
    margin: 30px 0;
    text-align: center;
    min-height: 100px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #999;
    font-size: 0.9em;
}

/* PIE DE PÁGINA */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    border-top: 2px solid var(--color-borde);
    color: #666;
    font-size: 0.9em;
}

footer a {
    color: var(--color-primario);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* RESPONSIVE */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.8em;
    }

    .generador {
        padding: 20px;
    }

    .resultado {
        flex-direction: column;
    }

    .btn-copiar {
        width: 100%;
    }
}
