* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #4a90e2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    pointer-events: none;
}

.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
    width: 4px;
    height: 4px;
    left: 10%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    width: 6px;
    height: 6px;
    left: 20%;
    animation-delay: 2s;
}

.particle:nth-child(3) {
    width: 3px;
    height: 3px;
    left: 30%;
    animation-delay: 4s;
}

.particle:nth-child(4) {
    width: 5px;
    height: 5px;
    left: 40%;
    animation-delay: 1s;
}

.particle:nth-child(5) {
    width: 4px;
    height: 4px;
    left: 50%;
    animation-delay: 3s;
}

.particle:nth-child(6) {
    width: 6px;
    height: 6px;
    left: 60%;
    animation-delay: 5s;
}

.particle:nth-child(7) {
    width: 3px;
    height: 3px;
    left: 70%;
    animation-delay: 2s;
}

.particle:nth-child(8) {
    width: 5px;
    height: 5px;
    left: 80%;
    animation-delay: 4s;
}

.particle:nth-child(9) {
    width: 4px;
    height: 4px;
    left: 90%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.container {
    background: white;
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(30, 60, 114, 0.2);
    max-width: 800px;
    width: 100%;
    overflow: hidden;
    animation: slideInUp 0.8s ease-out;
    position: relative;
    z-index: 1;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #4a90e2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.15"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.15"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/><circle cx="15" cy="85" r="0.8" fill="white" opacity="0.12"/><circle cx="85" cy="15" r="0.8" fill="white" opacity="0.12"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.logo-container {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    text-align: center;
}

.logo {
    width: auto;
    height: auto;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 250px;
}

.logo-img {
    width: 100%;
    height: auto;
    max-width: 250px;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
    border-radius: 8px;
}

.form-container {
    padding: 40px;
    background: #fafbfc;
    position: relative;
    overflow: visible;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
    z-index: 1;
}

/* Cuando el dropdown está visible, dar más espacio al grupo de nombre */
.form-group.dropdown-visible {
    margin-bottom: 280px;
    z-index: 10;
}

.form-group:hover {
    transform: translateY(-2px);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-group label i {
    margin-right: 8px;
    color: #2a5298;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d0d9e8;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4a90e2;
    background: white;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.form-group input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Búsqueda de nombres */
.nombre-search {
    position: relative;
    width: 100%;
    z-index: 100;
}

#buscar_nombre {
    text-transform: uppercase;
}

.resultados-busqueda {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    border: 1px solid #d0d9e8;
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: none;
    margin-top: 2px;
    margin-bottom: 0;
}

/* Scrollbar personalizado para el dropdown */
.resultados-busqueda::-webkit-scrollbar {
    width: 6px;
}

.resultados-busqueda::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

.resultados-busqueda::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 8px;
}

.resultados-busqueda::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.resultado-item {
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    display: block;
    width: 100%;
    text-align: left;
}

.resultado-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.resultado-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.resultado-item:hover {
    background-color: #f0f7ff;
    transform: translateX(2px);
}

.resultado-item strong {
    display: block;
    color: #333;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
}

.resultado-item small {
    display: block;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.3;
}

.resultado-item.error {
    color: #d32f2f;
    cursor: default;
    background-color: #fff5f5;
}

.resultado-item.error:hover {
    background-color: #fff5f5;
    transform: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    padding: 12px 16px;
    border: 2px dashed #d0d9e8;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-direction: column;
}

.file-upload-label:hover {
    border-color: #4a90e2;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
}

.file-upload-label i {
    font-size: 24px;
    color: #4a90e2;
}

.file-upload-label span {
    font-size: 0.9rem;
    color: #666;
}

.file-upload input[type="file"]:focus + .file-upload-label {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.priority-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.priority-option {
    position: relative;
}

.priority-option input[type="radio"] {
    display: none;
}

.priority-option label {
    display: block;
    padding: 12px;
    text-align: center;
    border: 1px solid #d0d9e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    background: white;
    position: relative;
    border-left-width: 4px;
}

.priority-option input[type="radio"]:checked + label {
    border-color: #4a90e2;
    background: #f8f9ff;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
}

.priority-CRITICO {
    border-left-color: #dc3545 !important;
}

.priority-option input[type="radio"]:checked + .priority-CRITICO {
    background: #fff5f5;
    border-color: #dc3545;
}

.priority-ALTO {
    border-left-color: #fd7e14 !important;
}

.priority-option input[type="radio"]:checked + .priority-ALTO {
    background: #fff8f0;
    border-color: #fd7e14;
}

.priority-NORMAL {
    border-left-color: #28a745 !important;
}

.priority-option input[type="radio"]:checked + .priority-NORMAL {
    background: #f0fff4;
    border-color: #28a745;
}

.priority-BAJO {
    border-left-color: #6c757d !important;
}

.priority-option input[type="radio"]:checked + .priority-BAJO {
    background: #f8f9fa;
    border-color: #6c757d;
}

.priority-info {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 8px;
    border: 1px solid #d0d9e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.priority-info-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.priority-description {
    margin: 0;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 500;
}

.priority-time {
    margin: 0;
    color: #4a90e2;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.priority-time i {
    color: #4a90e2;
}

.priority-time .time-text {
    color: #2a5298;
}

.vendedora-search {
    position: relative;
}

#resultadosVendedora {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e1e5e9;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.resultado-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.resultado-item:hover {
    background: #f8f9fa;
}

.resultado-item:last-child {
    border-bottom: none;
}

.resultado-item strong {
    display: block;
    color: #333;
    margin-bottom: 4px;
}

.resultado-item small {
    color: #666;
    font-size: 12px;
}

.vendedora-seleccionada {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f0ff 100%);
    border: 2px solid #2a5298;
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vendedora-seleccionada div {
    flex: 1;
}

.vendedora-seleccionada strong {
    display: block;
    color: #333;
    margin-bottom: 5px;
}

.vendedora-seleccionada small {
    display: block;
    font-size: 14px;
    color: #666;
}

.btn-change {
    background: #2a5298;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-change:hover {
    background: #1e3c72;
    transform: translateY(-2px);
}

.auth-box {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f0ff 100%);
    border: 2px solid #2a5298;
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
}

.auth-box h3 {
    color: #2a5298;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.auth-box h3 i {
    margin-right: 8px;
}

.error-message {
    color: #dc3545;
    margin-top: 10px;
    font-size: 14px;
    padding: 10px;
    background: #fee;
    border-radius: 6px;
    border-left: 4px solid #dc3545;
}

.captcha-container {
    background: linear-gradient(135deg, #e8f0ff 0%, #f0e8ff 100%);
    border-radius: 12px 12px 0 0;
    padding: 20px;
    margin: 20px 0;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.captcha-container p {
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
    text-align: left;
    font-size: 0.95rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.captcha-container p i {
    margin-right: 8px;
    color: #1e3c72;
}

.simple-captcha {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.captcha-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #d0d9e8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    min-width: 120px;
    min-height: 60px;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(200, 200, 200, 0.15) 1px, transparent 1px),
        radial-gradient(circle at 60% 70%, rgba(200, 200, 200, 0.15) 1px, transparent 1px),
        radial-gradient(circle at 80% 40%, rgba(200, 200, 200, 0.12) 1px, transparent 1px);
    background-size: 30px 30px, 25px 25px, 35px 35px;
}

#captchaDisplay {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 4px;
    color: #1e3c72;
    font-family: 'Courier New', monospace;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    background: transparent;
    padding: 0;
    border: none;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.btn-refresh {
    background: #4a90e2;
    color: white;
    border: 2px solid #4a90e2;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.btn-refresh:hover {
    transform: rotate(180deg);
    background: #357abd;
    border-color: #357abd;
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.4);
}

.btn-refresh:active {
    transform: rotate(180deg) scale(0.95);
}

#captchaInput {
    flex: 1;
    min-width: 250px;
    padding: 14px 18px;
    border: 1px solid #d0d9e8;
    border-radius: 8px;
    font-size: 14px;
    text-align: left;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: white;
    transition: all 0.3s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

#captchaInput::placeholder {
    color: #999;
    text-transform: none;
    letter-spacing: normal;
}

#captchaInput:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.submit-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.submit-btn:hover {
    background: #357ABD;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn i {
    margin-right: 10px;
}

.loading {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2a5298;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e1e5e9;
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #4a90e2 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.ver-solicitud {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px 40px;
    margin: 20px;
    text-align: center;
    border: 2px solid #e1e5e9;
}

.ver-solicitud h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.ver-solicitud h3 i {
    margin-right: 8px;
    color: #2a5298;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #2a5298;
    color: white;
}

.btn-primary:hover {
    background: #1e3c72;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .form-grid-two {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .priority-group {
        grid-template-columns: 1fr 1fr;
    }
    
    .ver-solicitud {
        padding: 20px;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .form-container {
        padding: 15px;
    }
    
    #captchaInput {
        width: 100%;
    }
}
