@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary: #e63946;
    --primary-hover: #d62828;
    --secondary: #1d3557;
    --accent: #457b9d;
    --success: #2a9d8f;
    --whatsapp: #25D366;
    --whatsapp-hover: #1da851;
    --warning: #f4a261;
    --bg-gradient: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    --card-bg: #ffffff;
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --border-color: #e2e8f0;
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow: 0 10px 30px rgba(29, 53, 87, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 30px 15px;
}

.contenedor-principal {
    background-color: var(--card-bg);
    padding: 2.5em;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 580px;
    margin: 10px auto;
    position: relative;
    overflow: hidden;
    border-top: 6px solid var(--primary);
}

.header-app {
    text-align: center;
    margin-bottom: 1.8em;
}

.header-icono {
    font-size: 3em;
    line-height: 1;
    margin-bottom: 0.2em;
    display: inline-block;
}

h1 {
    color: var(--secondary);
    text-align: center;
    margin: 0 0 0.3em 0;
    font-size: 1.85em;
    font-weight: 700;
}

p.subtitulo {
    text-align: center;
    color: var(--text-muted);
    margin: 0 auto 1.5em auto;
    font-size: 0.98em;
    line-height: 1.5;
}

/* Acordeón de "¿Cómo funciona?" */
details.paso-a-paso {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1em 1.25em;
    margin-bottom: 1.8em;
    transition: all 0.2s ease;
}

details.paso-a-paso summary {
    font-weight: 600;
    color: var(--secondary);
    cursor: pointer;
    font-size: 1.05em;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

details.paso-a-paso summary::-webkit-details-marker {
    display: none;
}

details.paso-a-paso summary::after {
    content: "▼";
    font-size: 0.8em;
    color: var(--primary);
    transition: transform 0.2s ease;
}

details.paso-a-paso[open] summary::after {
    transform: rotate(180deg);
}

details.paso-a-paso ol {
    padding-left: 20px;
    margin: 1em 0 0 0;
    border-top: 1px solid var(--border-color);
    padding-top: 1em;
}

details.paso-a-paso li {
    color: var(--text-main);
    font-size: 0.92em;
    line-height: 1.6;
    margin-bottom: 0.6em;
}

/* Formularios */
.campo-formulario {
    margin-bottom: 1.3em;
}

.campo-formulario label {
    display: block;
    margin-bottom: 0.45em;
    font-weight: 600;
    font-size: 0.92em;
    color: var(--secondary);
}

.campo-formulario input[type="text"],
.campo-formulario input[type="date"],
.campo-formulario input[type="number"],
.campo-formulario input[type="email"],
.campo-formulario input[type="password"],
.campo-formulario textarea,
.campo-formulario select {
    width: 100%;
    padding: 0.85em 1em;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95em;
    font-family: inherit;
    color: var(--text-main);
    background-color: #fcfdfe;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.campo-formulario input:focus,
.campo-formulario textarea:focus,
.campo-formulario select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.12);
    background-color: #fff;
}

.ayuda-campo {
    display: block;
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 0.35em;
}

/* Botones */
.boton-primario,
.boton-crear {
    width: 100%;
    padding: 0.95em 1.2em;
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05em;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    text-align: center;
}

.boton-primario:hover,
.boton-crear:hover {
    background-color: var(--primary-hover);
}

.boton-primario:active,
.boton-crear:active {
    transform: scale(0.99);
}

.boton-secundario {
    background-color: var(--secondary);
    color: #fff;
    padding: 0.75em 1.1em;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.92em;
    transition: opacity 0.2s;
}

.boton-secundario:hover {
    opacity: 0.92;
}

.boton-whatsapp {
    background-color: var(--whatsapp);
    color: #fff;
    width: 100%;
    padding: 0.85em 1.2em;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 0.6em;
    transition: background-color 0.2s;
}

.boton-whatsapp:hover {
    background-color: var(--whatsapp-hover);
}

/* Tarjetas de Enlace y Resumen */
.caja-enlace {
    background: #f8fafc;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25em;
    margin-bottom: 1.3em;
}

.caja-enlace.admin-box {
    background: #fff8f6;
    border-color: #f8d7da;
}

.caja-enlace h3 {
    margin: 0 0 0.4em 0;
    font-size: 1.05em;
    color: var(--secondary);
}

.input-copiar-grupo {
    display: flex;
    gap: 8px;
    margin-top: 0.6em;
}

.input-copiar-grupo input {
    flex: 1;
    padding: 0.7em 0.9em;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.88em;
    background: #fff;
    color: #334155;
}

.btn-copiar {
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 1em;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88em;
    white-space: nowrap;
}

.btn-copiar:hover {
    background: #0f172a;
}

.resumen-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 1.5em;
}

.badge {
    background: #f1f5f9;
    color: var(--secondary);
    padding: 0.4em 0.9em;
    border-radius: 999px;
    font-size: 0.85em;
    font-weight: 600;
}

.qr-container {
    text-align: center;
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px dashed var(--border-color);
}

.qr-container img {
    border-radius: 8px;
    border: 4px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Toast flotante */
.toast-copiado {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: #fff;
    padding: 0.8em 1.5em;
    border-radius: 999px;
    font-size: 0.9em;
    font-weight: 500;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.toast-copiado.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (max-width: 600px) {
    body {
        padding: 0;
    }
    .contenedor-principal {
        border-radius: 0;
        min-height: 100vh;
        margin: 0;
        padding: 1.8em 1.25em;
        box-shadow: none;
    }
    .input-copiar-grupo {
        flex-direction: column;
    }
    .btn-copiar {
        padding: 0.75em;
    }
}