/*
 * Campos de formulario con el estilo de Bootstrap 5.3 (.form-control / .form-select).
 * Se aplica por selector de ELEMENTO a todo el sitio para no tener que tocar cada
 * vista, y SIN cargar toda la libreria Bootstrap (que romperia el tema HTML5UP).
 * Las clases propias del sitio (mayor especificidad) siguen mandando.
 */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"],
input[type="week"],
textarea,
select {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-shadow: none;
    height: auto !important;
    min-height: calc(1.5em + 0.75rem + 2px);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

select {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

textarea {
    min-height: 7.5rem !important;
    resize: vertical;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
textarea:focus,
select:focus {
    color: #212529;
    background-color: #fff;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

input::placeholder,
textarea::placeholder {
    color: #6c757d;
    opacity: 1;
}

input:disabled,
textarea:disabled,
select:disabled,
input[readonly],
textarea[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

label {
    margin-bottom: 0.5rem;
}

/* ============================================================
 * Botones estilo Bootstrap 5.3 (neutraliza el uppercase / letter-spacing
 * / alto fijo del tema HTML5UP). Se excluyen los botones propios del sitio
 * que tienen su propio diseno (paginador, X del modal).
 * ============================================================ */

input[type="submit"],
input[type="reset"],
input[type="button"],
button,
.button,
.btn {
    border-radius: 0.375rem;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    height: auto !important;
    letter-spacing: normal !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    text-transform: none !important;
}

input[type="submit"],
input[type="reset"],
input[type="button"],
button:not(.rl-page):not(.rv-modal__close),
.button,
.btn {
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
    border: 1px solid #ced4da !important;
    box-shadow: none !important;
    color: #495057;
    cursor: pointer;
    display: inline-block;
    margin-top: 0;
    padding: 0.4rem 0.95rem !important;
    text-align: center;
    transition: color .15s, background-color .15s, border-color .15s;
    white-space: nowrap;
}

input[type="submit"]:hover,
input[type="reset"]:hover,
input[type="button"]:hover,
button:hover,
.button:hover,
.btn:hover {
    background-color: #f1f3f5 !important;
    border-color: #86b7fe !important;
    box-shadow: none !important;
    color: #212529 !important;
}

/* Variantes de color (la clase gana sobre el look base) */
.btn-primary,
.btn-success,
.button.special,
button.special,
input.special {
    background-color: #246b55 !important;
    border-color: #246b55 !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-success:hover,
.button.special:hover,
button.special:hover {
    background-color: #1f5d49 !important;
    border-color: #1f5d49 !important;
    color: #fff !important;
}

.btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

.btn-danger:hover {
    background-color: #bb2d3b !important;
    border-color: #b02a37 !important;
    color: #fff !important;
}

.btn-secondary,
.btn-default {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
}

.btn-secondary:hover,
.btn-default:hover {
    background-color: #5c636a !important;
    border-color: #565e64 !important;
    color: #fff !important;
}

/* ============================================================
 * Checkbox / radio estilo Bootstrap. El tema oculta el input real
 * (opacity:0) y dibuja el control en `label:before`; lo restilizamos.
 * ============================================================ */

input[type="checkbox"] + label:before,
input[type="radio"] + label:before {
    background: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.25) !important;
    height: 1.3em !important;
    line-height: 1.2em !important;
    top: 0.15em !important;
    width: 1.3em !important;
}

input[type="checkbox"] + label:before {
    border-radius: 0.25em !important;
}

input[type="radio"] + label:before {
    border-radius: 50% !important;
}

input[type="checkbox"]:checked + label:before,
input[type="radio"]:checked + label:before {
    background: #246b55 !important;
    border-color: #246b55 !important;
    color: #fff !important;
}

input[type="checkbox"]:focus + label:before,
input[type="radio"]:focus + label:before {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}
