/* =====================================================
   NEXGEWEB - FORMULARIO DE CREACIÓN DE WEBS
   ===================================================== */

.wizard-section {
    --wizard-primary: #2563eb;
    --wizard-primary-hover: #1d4ed8;
    --wizard-text: #0f172a;
    --wizard-muted: #64748b;
    --wizard-border: #e2e8f0;
    --wizard-background: #f8fafc;
    --wizard-white: #ffffff;

    padding: 65px 20px 80px;
    background: var(--wizard-background);
    color: var(--wizard-text);
}

.wizard-section *,
.wizard-section *::before,
.wizard-section *::after {
    box-sizing: border-box;
}

.wizard-section [hidden] {
    display: none !important;
}

.wizard-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    min-width: 0;
}


/* =====================================================
   CABECERA
   ===================================================== */

.wizard-heading {
    text-align: center;
    margin-bottom: 35px;
}

.wizard-badge {
    display: inline-block;
    padding: 7px 15px;
    border-radius: 30px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.wizard-heading h1 {
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.2;
    margin: 0 0 15px;
    font-weight: 800;
    color: var(--wizard-text);
}

.wizard-heading p {
    max-width: 650px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.7;
    color: var(--wizard-muted);
}


/* =====================================================
   INDICADOR DE PROGRESO
   ===================================================== */

.wizard-progress {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
}

.wizard-progress-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--wizard-muted);
    min-width: 0;
}

.wizard-progress-item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 21px;
    left: calc(50% + 26px);
    width: calc(100% - 52px);
    height: 3px;
    background: var(--wizard-border);
    border-radius: 10px;
}

.wizard-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 2px solid var(--wizard-border);
    border-radius: 50%;
    background: var(--wizard-white);
    font-size: 16px;
    font-weight: 700;
    transition: background 0.2s, border-color 0.2s;
}

.wizard-progress-item.active {
    color: var(--wizard-primary);
}

.wizard-progress-item.active .wizard-number {
    background: var(--wizard-primary);
    border-color: var(--wizard-primary);
    color: white;
    box-shadow: 0 0 0 5px #dbeafe;
}

.wizard-progress-item.completed .wizard-number {
    background: #15803d;
    border-color: #15803d;
    color: white;
}

.wizard-progress-item.completed::after {
    background: #15803d;
}


/* =====================================================
   CONTENEDOR DEL FORMULARIO
   ===================================================== */

.wizard-form {
    width: 100%;
    min-width: 0;
    padding: 38px;
    border: 1px solid var(--wizard-border);
    border-radius: 20px;
    background: var(--wizard-white);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.07);
}

.wizard-step {
    min-width: 0;
}

.wizard-step-heading {
    padding-bottom: 20px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--wizard-border);
}

.wizard-step-heading h2 {
    margin: 0 0 8px;
    font-size: clamp(22px, 3vw, 28px);
    line-height: 1.3;
    color: var(--wizard-text);
}

.wizard-step-heading p {
    margin: 0;
    color: var(--wizard-muted);
    font-size: 15px;
    line-height: 1.6;
}


/* =====================================================
   CAMPOS
   ===================================================== */

.wizard-field {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 0 0 23px;
    min-width: 0;
}

fieldset.wizard-field {
    padding: 0;
    border: 0;
}

.wizard-field label,
.wizard-field legend {
    font-size: 14px;
    font-weight: 650;
    color: var(--wizard-text);
}

.wizard-field legend {
    margin-bottom: 12px;
}

.wizard-field small {
    font-size: 12px;
    line-height: 1.5;
    color: var(--wizard-muted);
}

.wizard-field input:not([type="checkbox"]):not([type="radio"]),
.wizard-field textarea,
.wizard-field select {
    width: 100%;
    min-width: 0;
    padding: 13px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: var(--wizard-white);
    color: var(--wizard-text);
    font: inherit;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wizard-field input:focus,
.wizard-field textarea:focus,
.wizard-field select:focus {
    outline: none;
    border-color: var(--wizard-primary);
    box-shadow: 0 0 0 3px #dbeafe;
}

.wizard-field input::placeholder,
.wizard-field textarea::placeholder {
    color: #64748b;
}

.wizard-field textarea {
    resize: vertical;
    min-height: 100px;
}

.wizard-field select {
    min-height: 48px;
    cursor: pointer;
}

.wizard-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
}


/* =====================================================
   CATEGORÍAS
   ===================================================== */

.wizard-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.wizard-category {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    min-height: 165px;
    padding: 25px 15px;
    border: 2px solid var(--wizard-border);
    border-radius: 14px;
    background: var(--wizard-white);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.wizard-category:hover {
    border-color: var(--wizard-primary);
    background: #f8fbff;
}

.wizard-category:has(input:checked) {
    border-color: var(--wizard-primary);
    background: #eff6ff;
}

.wizard-category:focus-within {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

.wizard-category input {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 17px;
    height: 17px;
    accent-color: var(--wizard-primary);
}

.wizard-category-icon {
    font-size: 34px;
    line-height: 1.2;
}

.wizard-category strong {
    font-size: 16px;
}

.wizard-category small {
    font-size: 12px;
    font-weight: 400;
}


/* =====================================================
   COLORES Y VISTA PREVIA
   ===================================================== */

.wizard-color-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.wizard-field input[type="color"] {
    height: 65px;
    padding: 6px;
    cursor: pointer;
}

.wizard-design-preview {
    padding: 30px;
    margin-top: 10px;
    border: 1px solid var(--wizard-border);
    border-radius: 15px;
    background: #ffffff;
    text-align: center;
    overflow-wrap: anywhere;
}

.wizard-design-preview small {
    display: block;
    margin-bottom: 15px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.wizard-design-preview h3 {
    margin: 0 0 10px;
    font-size: 26px;
    line-height: 1.3;
}

.wizard-design-preview p {
    margin: 0 0 20px;
    font-size: 14px;
}

#previewButton {
    display: inline-block;
    padding: 11px 20px;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
}


/* =====================================================
   SERVICIOS
   ===================================================== */

.wizard-service {
    min-width: 0;
    padding: 22px;
    margin-bottom: 16px;
    border: 1px solid var(--wizard-border);
    border-radius: 12px;
    background: var(--wizard-background);
}

.wizard-service .wizard-field:last-of-type {
    margin-bottom: 15px;
}

.wizard-add-button,
.wizard-remove-service {
    padding: 10px 16px;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.wizard-add-button {
    margin-bottom: 25px;
    border: 1px dashed var(--wizard-primary);
    background: #eff6ff;
    color: #1d4ed8;
}

.wizard-add-button:hover {
    background: #dbeafe;
}

.wizard-remove-service {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.wizard-remove-service:hover {
    background: #fee2e2;
}


/* =====================================================
   OPCIONES Y FUNCIONALIDADES
   ===================================================== */

.wizard-options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.wizard-option {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    min-height: 52px;
    padding: 14px;
    border: 1px solid var(--wizard-border);
    border-radius: 10px;
    background: var(--wizard-white);
    font-size: 14px;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.wizard-option:has(input:checked) {
    background: #eff6ff;
    border-color: #93c5fd;
}

.wizard-option:has(input:disabled) {
    background: #f1f5f9;
    border-color: var(--wizard-border);
    cursor: default;
}

.wizard-option input,
.wizard-consent input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--wizard-primary);
}


/* =====================================================
   RESUMEN Y CONFIRMACIÓN
   ===================================================== */

.wizard-summary {
    padding: 24px;
    margin-bottom: 25px;
    border: 1px solid var(--wizard-border);
    border-radius: 12px;
    background: var(--wizard-background);
    overflow-wrap: anywhere;
}

.wizard-summary:empty {
    display: none;
}

.wizard-summary h3 {
    margin: 0 0 15px;
    color: var(--wizard-text);
    font-size: 18px;
}

.wizard-summary p {
    margin: 0 0 10px;
    color: var(--wizard-muted);
    font-size: 14px;
    line-height: 1.6;
}

.wizard-summary-group {
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--wizard-border);
}

.wizard-summary-group:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.wizard-consent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--wizard-text);
    cursor: pointer;
}

.wizard-consent input {
    margin-top: 3px;
}

.wizard-notice {
    padding: 16px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 13px;
    line-height: 1.6;
}


/* =====================================================
   MENSAJES
   ===================================================== */

.wizard-message {
    padding: 15px;
    margin-top: 20px;
    border: 1px solid var(--wizard-border);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.wizard-message.error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.wizard-message.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}


/* =====================================================
   NAVEGACIÓN
   ===================================================== */

.wizard-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 25px;
    margin-top: 25px;
    border-top: 1px solid var(--wizard-border);
}

.wizard-button {
    min-height: 48px;
    padding: 13px 24px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.wizard-primary {
    margin-left: auto;
    background: var(--wizard-primary);
    color: #ffffff;
}

.wizard-primary:hover:not(:disabled) {
    background: var(--wizard-primary-hover);
    transform: translateY(-1px);
}

.wizard-secondary {
    background: #f1f5f9;
    color: var(--wizard-text);
    border-color: var(--wizard-border);
}

.wizard-secondary:hover {
    background: #e2e8f0;
}

.wizard-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wizard-section button:focus-visible {
    outline: 3px solid #60a5fa;
    outline-offset: 3px;
}


/* =====================================================
   TABLETS
   ===================================================== */

@media (max-width: 900px) {

    .wizard-section {
        padding: 45px 20px 60px;
    }

    .wizard-form {
        padding: 28px;
    }

    .wizard-category-grid {
        gap: 12px;
    }

    .wizard-category {
        padding: 22px 12px;
    }

}


/* =====================================================
   MÓVILES
   ===================================================== */

@media (max-width: 600px) {

    .wizard-section {
        padding: 30px 12px 45px;
    }

    .wizard-heading {
        margin-bottom: 25px;
    }

    .wizard-heading h1 {
        font-size: 28px;
    }

    .wizard-heading p {
        font-size: 14px;
    }

    .wizard-progress {
        margin-bottom: 25px;
    }

    .wizard-progress-item {
        font-size: 10px;
        gap: 8px;
    }

    .wizard-number {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .wizard-progress-item:not(:last-child)::after {
        top: 16px;
        left: calc(50% + 21px);
        width: calc(100% - 42px);
        height: 2px;
    }

    .wizard-form {
        padding: 20px 15px;
        border-radius: 14px;
    }

    .wizard-step-heading {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .wizard-step-heading h2 {
        font-size: 22px;
    }

    .wizard-step-heading p {
        font-size: 14px;
    }

    .wizard-category-grid,
    .wizard-fields-grid,
    .wizard-options-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .wizard-category {
        min-height: 120px;
        padding: 18px;
    }

    .wizard-category-icon {
        font-size: 28px;
    }

    .wizard-color-grid {
        gap: 8px;
    }

    .wizard-color-grid label {
        font-size: 11px;
    }

    .wizard-field input[type="color"] {
        height: 48px;
    }

    .wizard-field input:not([type="checkbox"]):not([type="radio"]),
    .wizard-field textarea,
    .wizard-field select {
        font-size: 16px;
    }

    .wizard-service {
        padding: 15px;
    }

    .wizard-summary,
    .wizard-design-preview {
        padding: 18px;
    }

    .wizard-navigation {
        gap: 10px;
    }

    .wizard-button {
        flex: 1 1 120px;
        padding: 12px 14px;
        font-size: 13px;
    }

}


/* =====================================================
   ACCESIBILIDAD
   ===================================================== */

@media (prefers-reduced-motion: reduce) {

    .wizard-section *,
    .wizard-section *::before,
    .wizard-section *::after {
        animation: none !important;
        transition: none !important;
    }

}
/* =====================================================
   AJUSTE DE SEPARACIÓN CON LA CABECERA FIJA
   ===================================================== */

.wizard-section {
    padding-top: 110px;
}

.wizard-progress {
    scroll-margin-top: 100px;
}

@media (max-width: 900px) {
    .wizard-section {
        padding-top: 105px;
    }
}

@media (max-width: 600px) {
    .wizard-section {
        padding-top: 95px;
    }
}


/* FOTOGRAFÍAS PERSONALIZADAS */

#wizardImages {
    margin-top: 28px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    min-width: 0;
}

#wizardImages[hidden] {
    display: none !important;
}

#wizardImages legend {
    font-size: 18px;
    font-weight: 700;
    padding: 0 10px;
}

#wizardImages input[type="file"] {
    width: 100%;
    padding: 16px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    background: #f8fafc;
    color: #334155;
}

#previewPortada img {
    display: block;
    width: 100%;
    max-width: 480px;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin: 12px 0;
}

#previewGaleria {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 15px;
}

.wizard-image-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.wizard-image-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.wizard-image-card input {
    width: 100%;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    #previewGaleria {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    #wizardImages {
        padding: 15px;
    }

    #previewGaleria {
        grid-template-columns: 1fr;
    }
}


/* FOTOGRAFÍAS PERSONALIZADAS */

#wizardImages {
    margin-top: 28px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    min-width: 0;
}

#wizardImages[hidden] {
    display: none !important;
}

#wizardImages legend {
    font-size: 18px;
    font-weight: 700;
    padding: 0 10px;
}

#wizardImages input[type="file"] {
    width: 100%;
    padding: 16px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    background: #f8fafc;
    color: #334155;
}

#previewPortada img {
    display: block;
    width: 100%;
    max-width: 480px;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin: 12px 0;
}

#previewGaleria {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 15px;
}

.wizard-image-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.wizard-image-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.wizard-image-card input {
    width: 100%;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    #previewGaleria {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    #wizardImages {
        padding: 15px;
    }

    #previewGaleria {
        grid-template-columns: 1fr;
    }
}
