/* Canvas Background */
#backgroundCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* General Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f1f5f9;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- BARRA SUPERIOR RESTAURADA Y MEJORADA --- */
.form-header-minimal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    padding-top: calc(15px + env(safe-area-inset-top, 0px));
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.85);
    /* Efecto cristal */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    /* Vuelve a quedarse pegada al hacer scroll */
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.form-header-minimal a {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.form-header-minimal .logo {
    height: 40px;
    transition: transform 0.3s ease;
}

.form-header-minimal .logo:hover {
    transform: scale(1.05);
}

.form-header-minimal .brand-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.5px;
}

.form-header-minimal .btn-back {
    background: white;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 18px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-header-minimal .btn-back:hover {
    background-color: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Layout Master Split-Screen */
.solicitud-layout-master {
    display: flex;
    max-width: 1100px;
    margin: 20px auto 60px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 800px;
}

.solicitud-sidebar {
    width: 35%;
    background-size: cover;
    background-position: center;
    padding: 50px 40px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.sidebar-title {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 15px;
    border: none;
    padding: 0;
    color: white;
    font-weight: 800;
}

.sidebar-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.5;
}

.trust-badges {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge-icon {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.2);
    padding: 12px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-item div {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
}

/* Form Wrapper */
.solicitud-form-wrapper {
    width: 65%;
    padding: 50px 60px;
    background: #ffffff;
}

.form-main-title {
    font-size: 1.8rem;
    color: #0f172a;
    margin: 0 0 5px 0;
    font-weight: 800;
}

.form-main-subtitle {
    color: #64748b;
    margin-bottom: 35px;
}

.unified-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    width: 100%;
}

.form-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

.input-group label {
    display: block;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    background-color: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 1rem;
    color: #1e293b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
    background-color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 10px 0;
}

.unified-checkbox {
    margin-top: 10px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.unified-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn-submit {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 20px;
    font-size: 1.1rem;
    font-weight: 800;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px -5px rgba(37, 99, 235, 0.4);
}

/* Custom Fields */
.campo-personalizado {
    margin-top: 10px;
    display: none;
}

.input-con-simbolo {
    display: flex;
    align-items: center;
}

.input-con-simbolo span {
    background-color: #e2e8f0;
    padding: 14px 16px;
    border-radius: 12px 0 0 12px;
    border: 2px solid #e2e8f0;
    border-right: none;
    font-weight: bold;
}

.input-con-simbolo input {
    border-radius: 0 12px 12px 0 !important;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 40px;
    border-radius: 24px;
    width: 85%;
    max-width: 750px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    display: flex;
    flex-direction: column;
}

.close {
    position: absolute;
    top: 25px;
    right: 30px;
    color: #64748b;
    font-size: 32px;
    cursor: pointer;
}

.terminos-text {
    line-height: 1.7;
    overflow-y: auto;
    padding-right: 15px;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 900px) {
    .solicitud-layout-master {
        flex-direction: column;
        margin: 20px;
        min-height: auto;
    }

    .solicitud-sidebar {
        width: 100%;
        padding: 40px 30px;
    }

    .solicitud-form-wrapper {
        width: 100%;
        padding: 40px 30px;
    }

    .form-row {
        flex-direction: column;
        gap: 20px;
    }

    .form-header-minimal {
        padding: 20px;
    }

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

@media (max-width: 768px) {
    .solicitud-layout-master {
        margin: 15px;
        border-radius: 16px;
    }

    .solicitud-form-wrapper {
        padding: 30px 20px;
    }

    .form-row {
        gap: 15px;
        /* Menor espacio vertical entre secciones */
    }

    .unified-form {
        gap: 15px;
    }

    .btn-submit {
        width: 100%;
        min-height: 48px;
        /* Touch target */
        font-size: 1.1rem;
        padding: 15px 20px;
    }

    .unified-checkbox {
        align-items: flex-start;
    }

    .unified-checkbox input {
        margin-top: 3px;
        min-width: 18px;
    }

    .modal-content {
        width: 90%;
        padding: 25px 20px;
        max-height: 90vh;
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .form-header-minimal {
        padding: 10px 15px;
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
    }

    .form-header-minimal .logo {
        height: 32px;
    }

    .form-header-minimal .brand-text {
        display: none;
    }

    .form-header-minimal .btn-back {
        padding: 6px 12px;
        font-size: 13px;
    }

    .solicitud-layout-master {
        margin: 10px;
        border-radius: 12px;
    }

    .solicitud-sidebar {
        padding: 30px 20px;
    }

    .sidebar-title {
        font-size: 1.5rem;
    }

    .solicitud-form-wrapper {
        padding: 25px 15px;
    }

    .form-main-title {
        font-size: 1.5rem;
    }

    .modal-content {
        width: 95%;
        padding: 20px 15px;
    }
}