/* ================================================================
   RADIOS, CHECKBOX DE TÉRMINOS Y MODAL
   Variables compartidas: variables.css
   ================================================================ */

/* ================================================================
   01. RADIOS PERSONALIZADOS
   ================================================================ */
.radio-group {
    display: flex;
    gap: 2rem;
}

.radio-wrapper,
.radio-wrapper input[type="radio"],
#terminos,
#terminos_gr #verTerminos,
.cerrar-modal,
select:hover {
    cursor: pointer;
}

.radio-wrapper {
    position: relative;
    padding-left: 30px;
    color: var(--color-text-main);
    font-size: var(--font-size-desktop);
    font-weight: 500;
    user-select: none;
}

.radio-wrapper input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-custom {
    position: absolute;
    top: 3px;
    left: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-text-main);
    border-radius: 50%;
    background-color: var(--color-bg);
    transition: background var(--transition-base), border-color var(--transition-base);
}

.radio-wrapper:hover .radio-custom {
    border-color: var(--color-input-txt);
}

.radio-wrapper input:checked ~ .radio-custom {
    border-color: var(--color-text-main);
}

.radio-custom::after {
    content: "";
    position: absolute;
    display: none;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-main);
}

.radio-wrapper input:checked ~ .radio-custom::after {
    display: block;
}

/* ================================================================
   02. TÉRMINOS Y CONDICIONES
   ================================================================ */
#terminos_gr {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

#check_gr {
    display: flex;
    flex-direction: row;
    align-items: center;
}

#check_gr label {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin-right: auto;
    color: var(--color-input-txt);
    font-size: var(--font-size-desktop);
}

#terminos_gr #verTerminos {
    border: none;
    background: transparent;
    color: var(--color-input-txt);
    font-size: var(--font-size-desktop);
    text-decoration: underline;
}

#terminos {
    position: relative;
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    padding: 6px;
    border: 2px solid var(--color-input-txt);
    border-radius: 5px;
    outline: none;
    background-color: var(--color-bg);
    vertical-align: middle;
    appearance: none;
    -webkit-appearance: none;
}

#terminos::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--color-text-main);
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

#terminos:checked::after {
    padding: 5px;
    border-radius: 3px;
    background-color: var(--color-input-txt);
    opacity: 1;
}

/* ================================================================
   03. MODAL
   ================================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    display: none;
    width: 100vw;
    height: 100vh;
    align-items: center;
    justify-content: center;
    background-color: var(--color-overlay);
    animation: fadeIn 0.2s ease-out forwards;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    border-radius: var(--radius-input);
    background: var(--color-bg);
    box-shadow: var(--shadow-modal);
    animation: slideUp 0.2s ease-out forwards;
}

.modal-scroll {
    max-height: 60vh;
    margin: 2rem 0;
    padding: 20px;
    overflow-y: auto;
}

.modal-scroll h2 {
    margin-left: 1rem;
    color: var(--color-text-main);
    font-weight: 700;
}

.modal-scroll p {
    padding: 1rem;
}

.cerrar-modal {
    display: block;
    width: 90%;
    margin: 10px auto 20px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--color-text-main);
    color: var(--color-bg);
}

/* ================================================================
   04. SELECTS DEL FORMULARIO
   ================================================================ */
#formularioDonacion select {
    height: var(--control-height);
    padding: 13px 42px 13px 18px !important;
    background-image: url('../../img/arrow-bottom-menu.svg');
    background-repeat: no-repeat;
    background-position: right 18px center !important;
    background-size: 12px 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* ================================================================
   05. RESPONSIVE
   ================================================================ */
@media (max-width: 1023px) {
    #terminos_gr {
        flex-direction: column;
    }

    .modal-scroll p {
        padding: 0.1rem !important;
    }
}

@media (max-width: 556px) {
    .radio-group,
    #check_gr label {
        flex-direction: column;
    }
}

/* ================================================================
   06. ANIMACIONES
   ================================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}
