/* MODAL WORKBOOK PREMIUM - GABRIEL ROJAS COACH */
/* Diseño inspirado en el formulario de contacto */

/* Overlay del modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Container del modal */
.modal-workbook {
    position: relative;
    width: 90%;
    max-width: 650px;
    background: linear-gradient(135deg, var(--oscuro) 0%, #1a3a1a 100%);
    border-radius: 25px;
    padding: 3.5rem 3rem;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Botón cerrar */
.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 24px;
    height: 24px;
    stroke: #E8DCC4;
    stroke-width: 3;
}

/* Header del modal */
.modal-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.modal-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.modal-logo {
    width: 120px;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.02);
    }
}

.modal-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    background: rgba(232, 220, 196, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: #E8DCC4;
    margin-bottom: 0.8rem;
    line-height: 1.2;
}

.modal-subtitle {
    font-size: 1.1rem;
    color: rgba(232, 220, 196, 0.8);
    line-height: 1.6;
    font-weight: 500;
}

/* Formulario */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

/* Fila de prefijo + teléfono */
.form-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, rgba(232, 220, 196, 0.05) 0%, rgba(122, 155, 118, 0.05) 100%);
    border: 2px solid rgba(232, 220, 196, 0.2);
    border-radius: 15px;
    font-size: 1rem;
    color: #FFFFFF;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23E8DCC4' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
}

.form-group select option {
    background: #1a1a1a;
    color: #FFFFFF;
    padding: 0.5rem;
}

.form-group label {
    display: block;
    color: #E8DCC4;
    font-weight: 700;
    margin-bottom: 0.7rem;
    font-size: 1rem;
    letter-spacing: 0.3px;
}

.form-group label .required {
    color: #7A9B76;
    margin-left: 3px;
    font-size: 1.1rem;
}

.form-group input {
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, rgba(232, 220, 196, 0.05) 0%, rgba(122, 155, 118, 0.05) 100%);
    border: 2px solid rgba(232, 220, 196, 0.2);
    border-radius: 15px;
    font-size: 1rem;
    color: #FFFFFF;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus {
    outline: none;
    background: linear-gradient(135deg, rgba(232, 220, 196, 0.1) 0%, rgba(122, 155, 118, 0.1) 100%);
    border-color: #E8DCC4;
    box-shadow: 0 5px 20px rgba(232, 220, 196, 0.2), inset 0 2px 5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.form-group input.error {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.form-group .error-message {
    display: none;
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 0.6rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    border-left: 3px solid #ff6b6b;
}

.form-group.has-error .error-message {
    display: block;
    animation: shakeError 0.3s ease;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Iconos en inputs */
.form-group.with-icon {
    position: relative;
}

.form-group.with-icon::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-size: contain;
    opacity: 0.5;
    pointer-events: none;
}

.form-group.with-icon input {
    padding-left: 3rem;
}

/* Decoración de campos */
.form-group {
    position: relative;
}

.form-group::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -0.5rem;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #E8DCC4, #7A9B76);
    transition: width 0.4s ease;
}

.form-group:focus-within::before {
    width: 100%;
}

/* Botón submit */
.modal-submit {
    margin-top: 1rem;
    padding: 1.2rem 2rem;
    background: linear-gradient(135deg, #E8DCC4 0%, #D4C5A8 100%);
    color: #1A1A1A;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(232, 220, 196, 0.4);
    position: relative;
    overflow: hidden;
}

.modal-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(232, 220, 196, 0.5);
}

.modal-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.modal-submit:hover::before {
    width: 300px;
    height: 300px;
}

/* Footer del modal */
.modal-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(232, 220, 196, 0.2);
}

.modal-footer p {
    font-size: 0.9rem;
    color: rgba(232, 220, 196, 0.7);
    line-height: 1.5;
    font-weight: 600;
}

/* Mensaje de éxito */
.modal-success {
    display: none;
    text-align: center;
    padding: 3rem 2rem;
}

.modal-success.active {
    display: block;
}

.modal-success .success-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    animation: successPop 0.6s ease;
}

@keyframes successPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.modal-success h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #E8DCC4;
    margin-bottom: 1rem;
}

.modal-success p {
    font-size: 1.1rem;
    color: rgba(232, 220, 196, 0.9);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.btn-download-workbook {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1.3rem 2.5rem;
    background: linear-gradient(135deg, #E8DCC4 0%, #D4C5A8 100%);
    color: #1A1A1A;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 10px 30px rgba(232, 220, 196, 0.3);
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.btn-download-workbook:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(232, 220, 196, 0.5);
}

.btn-download-workbook svg {
    animation: bounceDownload 1.5s ease infinite;
}

@keyframes bounceDownload {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.modal-success .btn-close-modal {
    padding: 1rem 2.5rem;
    background: transparent;
    color: #E8DCC4;
    border: 2px solid rgba(232, 220, 196, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-success .btn-close-modal:hover {
    background: rgba(232, 220, 196, 0.1);
    border-color: #E8DCC4;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-workbook {
        width: 95%;
        padding: 2.5rem 1.5rem;
        border-radius: 20px;
    }

    .modal-title {
        font-size: 1.8rem;
    }

    .modal-subtitle {
        font-size: 0.95rem;
    }
    
    /* Fila de prefijo + teléfono en móvil */
    .form-row {
        grid-template-columns: 110px 1fr;
        gap: 0.8rem;
    }

    .form-group input,
    .form-group select {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    .modal-submit {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        top: 1rem;
        right: 1rem;
    }
}

/* Scrollbar personalizado para el modal */
.modal-workbook::-webkit-scrollbar {
    width: 8px;
}

.modal-workbook::-webkit-scrollbar-track {
    background: rgba(232, 220, 196, 0.1);
    border-radius: 10px;
}

.modal-workbook::-webkit-scrollbar-thumb {
    background: rgba(232, 220, 196, 0.3);
    border-radius: 10px;
}

.modal-workbook::-webkit-scrollbar-thumb:hover {
    background: rgba(232, 220, 196, 0.5);
}
