/* Tema Dark */
body { 
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%); 
    background-attachment: fixed;
    color: #f8f9fa;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.navbar { 
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    padding: 1rem 2rem !important;
    transition: all 0.3s ease;
}
.navbar:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6); }
.navbar .form-select { 
    border-radius: 20px; 
    padding: 8px 16px;
    background-color: #444;
    color: #f8f9fa;
    border: 1px solid #555;
    transition: all 0.3s ease;
}
.navbar .form-select:hover { border-color: #777; background-color: #555; }
.modal-title-theme { 
    color: #222 !important; 
    font-weight: bold; 
    background: #ddd; 
    padding: 8px 20px; 
    border-radius: 20px; 
    display: inline-block;
    transition: all 0.3s ease;
}
.modal-title-theme:hover { background: #eee; }

.navbar-brand-logo {
    width: auto;
    height: 56px;
    max-height: 56px;
    object-fit: contain;
}

.navbar-table {
    width: 100%;
    table-layout: fixed;
}

.navbar-top-row {
    white-space: nowrap;
}

.navbar-logo-cell,
.navbar-menu-cell {
    width: 1%;
    white-space: nowrap;
}

.navbar-company-cell {
    width: auto;
    min-width: 0;
}

.navbar-company-name {
    display: block;
    margin: 0;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Estilos Responsivos para Hamburguesa y Logotipo */
@media (max-width: 767px) {
    .navbar {
        padding: 0.75rem 0.5rem !important;
    }

    .navbar-logo-cell,
    .navbar-menu-cell {
        width: 52px;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .navbar-company-cell {
        padding: 10px 6px !important;
    }

    .navbar-company-name {
        font-size: clamp(0.95rem, 4vw, 1.1rem) !important;
    }

    img[alt="Logo"] {
        height: 52px !important;
        max-height: 52px !important;
    }

    .navbar-toggler {
        padding: 8px 10px !important;
    }

    .navbar-toggler i {
        font-size: 20px !important;
    }

    .navbar-table,
    .navbar-table > tbody {
        display: block !important;
        width: 100% !important;
    }

    .navbar-table > tbody > tr.navbar-top-row {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 0.35rem;
        width: 100% !important;
    }

    .navbar-table > tbody > tr.navbar-top-row > td {
        display: block !important;
        width: auto !important;
    }

    .navbar-table > tbody > tr:not(.navbar-top-row),
    .navbar-table > tbody > tr:not(.navbar-top-row) > td {
        display: block !important;
        width: 100% !important;
    }

    .navbar-logo-cell .navbar-brand-link,
    .navbar-menu-cell {
        display: flex !important;
        align-items: center;
    }

    .navbar-menu-cell {
        justify-content: flex-end;
    }

    .navbar-company-cell,
    .navbar-company-name {
        min-width: 0 !important;
        width: 100% !important;
    }

    .navbar .collapse > div,
    .navbar .collapse > div > div,
    .navbar .collapse form {
        width: 100% !important;
    }

    .navbar .collapse > div > div {
        align-items: stretch !important;
    }

    .navbar .collapse form {
        justify-content: flex-start !important;
        gap: 8px;
    }

    .navbar .collapse .form-select,
    .navbar .collapse button.form-select {
        width: 100% !important;
        min-width: 0 !important;
        font-size: 16px !important;
    }
}

@media (max-width: 479px) {
    img[alt="Logo"] {
        height: 46px !important;
        max-height: 46px !important;
    }
}

@media (max-width: 320px) {
    img[alt="Logo"] {
        height: 40px !important;
        max-height: 40px !important;
    }
}

/* Estilos del Botón Hamburguesa Bootstrap - SIEMPRE VISIBLE */
.navbar-toggler {
    display: inline-block !important;
    transition: all 0.3s ease;
    visibility: visible !important;
}

.navbar-toggler:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* Forzar que sea visible en TODAS las resoluciones, incluso desktop */
@media (min-width: 992px) {
    .navbar-toggler {
        display: inline-block !important;
        visibility: visible !important;
    }
}

/* Estilos modernos mejorados - Tema Dark */
.contenedor_form {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    background: rgba(45, 45, 45, 0.96) !important;
    border: 1px solid #444 !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contenedor_form:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

#form-peter-btn {
    background: linear-gradient(135deg, #444 0%, #333 100%) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    transition: all 0.3s ease !important;
    color: #f8f9fa !important;
    border-radius: 12px !important;
}

#form-peter-btn:hover {
    background: linear-gradient(135deg, #555 0%, #444 100%) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6) !important;
    transform: translateY(-1px);
}

body #form-peter-btn,
body button#form-peter-btn {
    background: linear-gradient(135deg, #444 0%, #333 100%) !important;
    background-color: #444 !important;
    background-image: linear-gradient(135deg, #444 0%, #333 100%) !important;
}

.form-control:focus {
    border-color: #666;
    box-shadow: 0 0 0 0.2rem rgba(102, 102, 102, 0.25);
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
}

.form-control, .form-select {
    background-color: #2d2d2d !important;
    border-color: #444 !important;
    color: #f8f9fa !important;
}

body .form-control,
body .form-select,
body input,
body select,
body textarea {
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
}

/* Tipografía mejorada */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #f8f9fa;
}

label {
    font-weight: 500;
    color: #ddd;
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #444;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
}

.form-control:hover, .form-select:hover {
    border-color: #555;
}

/* Animaciones para mensajes de error */
@keyframes slideInError {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message {
    animation: slideInError 0.3s ease-out;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    color: #ffffff !important;
}

.text-danger {
    color: #ffffff !important;
}

#error-message {
    color: #ffffff !important;
}

/* Mejoras Responsivas */
@media (max-width: 768px) {
    .contenedor_form {
        width: 99% !important;
        margin: 0 auto !important;
        padding: 20px 12px !important;
        border-radius: 12px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
}

/* Pantallas muy pequeñas - Espacio máximo horizontal */
@media (max-width: 480px) {
    .contenedor_form {
        padding: 16px 8px !important;
    }
}

/* Ultra pequeño - < 360px */
@media (max-width: 360px) {
    .contenedor_form {
        padding: 12px 4px !important;
    }
}

/* ════════════════════════════════════════════════════════════════ */
/* INPUTS CON ICONOS INTERNOS - TEMA DARK */
/* ════════════════════════════════════════════════════════════════ */

.input-group-icon {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group-icon .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #ddd;
    z-index: 10;
    font-size: 16px;
    pointer-events: none;
    transition: color 0.3s ease;
}

.input-group-icon .form-control {
    padding-left: 45px;
    height: 48px;
    border-radius: 10px;
    border: 2px solid #444;
    transition: all 0.3s ease;
    font-size: 15px;
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
}

body .input-group-icon .form-control,
body .input-group-icon input {
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
    border-color: #444 !important;
}

.input-group-icon .form-control:focus { 
    border-color: #666; 
    box-shadow: 0 0 0 4px rgba(102, 102, 102, 0.2);
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
}

body .input-group-icon .form-control:focus,
body .input-group-icon input:focus {
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
}
.input-group-icon:focus-within .input-icon { color: #fff; }

/* Inputs mejorados sin iconos */
.form-control, input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select.form-control, textarea.form-control {
    height: 48px;
    border-radius: 10px;
    border: 2px solid #444;
    padding: 12px 16px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
}

/* Mayor especificidad para inputs */
body .form-control,
body input[type="text"],
body input[type="email"],
body input[type="tel"],
body input[type="number"],
body input[type="name"],
body select.form-control,
body textarea.form-control {
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
    border-color: #444 !important;
}

body input.form-control,
body select.form-control,
body textarea.form-control {
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
}

textarea.form-control { height: auto; min-height: 120px; }
.form-control:hover { border-color: #555; }
.form-control:focus { 
    border-color: #666; 
    box-shadow: 0 0 0 4px rgba(102, 102, 102, 0.2); 
    outline: none;
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
}

/* Mayor especificidad para estados focus y hover */
body .form-control:hover,
body input:hover,
body select:hover,
body textarea:hover {
    border-color: #555 !important;
    background-color: #2d2d2d !important;
}

body .form-control:focus,
body input:focus,
body select:focus,
body textarea:focus {
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
    border-color: #666 !important;
}

/* Form groups con mejor spacing */
.form-group { margin-bottom: 1.5rem; }
.form-group label { font-weight: 600; font-size: 14px; color: #f8f9fa; margin-bottom: 8px; display: block; letter-spacing: -0.01em; }

/* Input prefix para teléfonos */
.input-group .form-control:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .form-control:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: none; }
.input-group .form-control:last-child:focus { border-left: 2px solid #666; }

/* Placeholder mejorado */
.form-control::placeholder { color: #999; font-size: 14px; font-weight: 400; }

/* Input válido (checkmark verde) */
.form-control:valid:not(:placeholder-shown) {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2328a745'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Validación para inputs específicos */
input.form-control:valid:not(:placeholder-shown),
textarea.form-control:valid:not(:placeholder-shown),
select.form-control:valid:not(:placeholder-shown) {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2328a745'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Input requerido vacío al hacer focus */
.form-control:required:invalid:focus { border-color: #ffc107; }

/* Cards con fondo oscuro */
.card {
    background-color: #2d2d2d !important;
    border-color: #444 !important;
    color: #f8f9fa !important;
}

.card-body {
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
}

/* Sobrescribir estilos de Bootstrap con mayor especificidad */
body .card,
body .card.shadow-sm {
    background-color: #2d2d2d !important;
    border-color: #444 !important;
    color: #f8f9fa !important;
}

body .card-body,
body .card .card-body {
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
}

/* Select mejorado */
select.form-control,
select.form-select {
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
    border-color: #444 !important;
}

select.form-control option,
select.form-select option {
    background-color: #2d2d2d;
    color: #f8f9fa;
}

/* Input color */
input[type="color"].form-control {
    background-color: #2d2d2d !important;
    border-color: #444 !important;
}

/* Datalist e inputs especiales */
input[list].form-control {
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
}

body input[list],
body input[list].form-control {
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
}

/* P con estilos especiales (checkbox términos) */
body p.form-control {
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
    border-color: #444 !important;
}

/* Áreas de texto */
body textarea,
body textarea.form-control {
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
}

/* Input groups */
body .input-group input,
body .input-group select {
    background-color: #2d2d2d !important;
    color: #f8f9fa !important;
}
