/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== VARIABLES ===== */
:root {
    --primario: #6d4aff;
    --primario-hover: #5a3fd6;
    --oscuro: #1a1a2e;
    --gris: #f4f4f8;
    --texto: #333;
    --texto-claro: #666;
    --blanco: #ffffff;
    --exito: #22c55e;
    --error: #ef4444;
    --radio: 10px;
    --sombra: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== BASE ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.7;
    color: var(--texto);
    scroll-behavior: smooth;
}

/* ===== HEADER ===== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--primario);
    color: var(--blanco);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.header-content h1 {
    font-size: 1.5rem;
}

nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0 2rem 1rem;
}

nav a {
    color: var(--blanco);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

nav a:hover {
    opacity: 0.8;
}

/* ===== MENU MÓVIL ===== */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--blanco);
    border-radius: 2px;
}

/* ===== MAIN ===== */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    margin-bottom: 3rem;
    padding: 2rem;
}

/* ===== HERO ===== */
.hero {
    text-align: center;
    background: var(--gris);
    border-radius: var(--radio);
}

.hero h2 {
    color: var(--primario);
    margin-bottom: 1rem;
}

/* ===== GRID DE SERVICIOS ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.card {
    background: var(--gris);
    padding: 1.5rem;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-4px);
}

.card h3 {
    color: var(--primario);
    margin-bottom: 0.5rem;
}

/* ===== FORMULARIO ===== */
.contacto-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--texto);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #ddd;
    border-radius: var(--radio);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primario);
}

/* ===== BOTONES ===== */
.btn-primary {
    background: var(--primario);
    color: var(--blanco);
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: var(--radio);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primario-hover);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== RESULTADOS (mensajes de la API) ===== */
.resultado {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radio);
    font-weight: 500;
    display: none;
}

.resultado.exito {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    color: var(--exito);
    border: 1px solid var(--exito);
}

.resultado.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

/* ===== FOOTER ===== */
footer {
    background: var(--oscuro);
    color: var(--blanco);
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    nav {
        display: none;
        flex-direction: column;
        padding: 1rem 2rem;
    }

    nav.active {
        display: flex;
    }

    .header-content {
        padding: 1rem;
    }

    section {
        padding: 1.5rem;
    }

    .hero h2 {
        font-size: 1.5rem;
    }
}
