/* Reset y Variables */
:root {
    --color-granate: #8B0000;
    --color-granate-dark: #660000;
    --color-granate-light: #A52A2A;
    --color-azul-marino: #1e3a5f;
    --color-azul-marino-dark: #152a45;
    --color-azul-marino-light: #2c5282;
    --color-white: #ffffff;
    --color-gray-light: #f8f9fa;
    --color-gray: #6c757d;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--color-azul-marino) 0%, var(--color-azul-marino-dark) 50%, var(--color-granate-dark) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 600px;
    background: var(--color-white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeIn 0.5s ease-in;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--color-granate) 0%, var(--color-granate-dark) 100%);
    color: var(--color-white);
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

/* Form Container */
.form-container {
    padding: 40px 30px;
}

/* Form Groups */
.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--color-azul-marino);
    margin-bottom: 10px;
    font-size: 1rem;
}

.form-group label svg {
    color: var(--color-granate);
}

/* Select Wrapper */
.select-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--color-white);
    cursor: pointer;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-granate);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.search-input::placeholder {
    color: var(--color-gray);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    border: 2px solid var(--color-granate);
    border-radius: 12px;
    margin-top: 5px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    display: none;
}

.dropdown-menu.active {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.dropdown-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

.dropdown-item:hover {
    background: linear-gradient(90deg, var(--color-azul-marino-light) 0%, var(--color-azul-marino) 100%);
    color: var(--color-white);
}

.dropdown-item.selected {
    background: var(--color-granate);
    color: var(--color-white);
    font-weight: 600;
}

.dropdown-menu::-webkit-scrollbar {
    width: 8px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--color-granate);
    border-radius: 10px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--color-granate-dark);
}

/* File Input */
.file-input-wrapper {
    position: relative;
}

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

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    border: 3px dashed var(--color-azul-marino);
    border-radius: 12px;
    background: var(--color-gray-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--color-azul-marino);
}

.file-label:hover {
    background: var(--color-azul-marino);
    color: var(--color-white);
    border-color: var(--color-azul-marino-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.file-icon {
    font-size: 1.5rem;
}

.file-name {
    margin-top: 10px;
    padding: 10px;
    background: var(--color-gray-light);
    border-radius: 8px;
    color: var(--color-azul-marino);
    font-size: 0.9rem;
    display: none;
    word-break: break-all;
}

.file-name.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--color-granate) 0%, var(--color-granate-dark) 100%);
    color: var(--color-white);
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.submit-btn:hover::before {
    width: 300px;
    height: 300px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

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

.submit-btn:disabled {
    background: var(--color-gray);
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn.loading .btn-loader {
    display: block;
}

/* Status Message */
.status-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    display: none;
    animation: fadeIn 0.3s ease;
}

.status-message.active {
    display: block;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* Footer */
.footer {
    background: var(--color-azul-marino);
    color: var(--color-white);
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ============================================
   ANIMACIÓN DE CONFIRMACIÓN CON TORO
   ============================================ */

.success-animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.success-animation-overlay.active {
    display: flex;
    animation: overlayFadeIn 0.5s ease forwards;
}

@keyframes overlayFadeIn {
    to {
        opacity: 1;
    }
}

.success-animation-container {
    position: relative;
    text-align: center;
}

/* Partículas de fondo */
.particles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--color-granate);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 2s ease-out forwards;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0.5s; }
.particle:nth-child(2) { left: 20%; animation-delay: 0.6s; background: var(--color-azul-marino); }
.particle:nth-child(3) { left: 30%; animation-delay: 0.7s; }
.particle:nth-child(4) { left: 40%; animation-delay: 0.8s; background: var(--color-azul-marino); }
.particle:nth-child(5) { left: 60%; animation-delay: 0.6s; }
.particle:nth-child(6) { left: 70%; animation-delay: 0.7s; background: var(--color-azul-marino); }
.particle:nth-child(7) { left: 80%; animation-delay: 0.8s; }
.particle:nth-child(8) { left: 90%; animation-delay: 0.9s; background: var(--color-azul-marino); }

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) scale(1.5);
    }
}

/* Contenedor del toro */
.bull-container {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 0 auto;
    animation: bullEntrance 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes bullEntrance {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.15) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* SVG del Toro */
.bull-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 15px 40px rgba(139, 0, 0, 0.4));
}

/* Círculo de éxito que crece detrás del toro */
.success-circle {
    animation: circleGrow 0.8s ease-out 0.8s forwards;
    transform-origin: center;
}

@keyframes circleGrow {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 0.3;
    }
    100% {
        opacity: 0.2;
        transform: scale(1);
    }
}

/* Animaciones de partes del toro */
.bull-body {
    animation: bullJump 0.6s ease-in-out 1s forwards;
    transform-origin: center;
}

@keyframes bullJump {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

.bull-head {
    animation: headNod 0.6s ease-in-out 1s forwards;
    transform-origin: 150px 180px;
}

@keyframes headNod {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(-5deg);
    }
}

.bull-horn-left, .bull-horn-right {
    animation: hornShine 1.5s ease-in-out infinite 1.5s;
}

@keyframes hornShine {
    0%, 100% {
        stroke: #8B0000;
        filter: drop-shadow(0 0 5px #8B0000);
    }
    50% {
        stroke: #FF0000;
        filter: drop-shadow(0 0 20px #FF0000);
    }
}

.bull-eye-happy {
    animation: eyesAppear 0.5s ease-out 1.2s forwards;
    opacity: 0;
}

@keyframes eyesAppear {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.bull-smile {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: smileDraw 0.8s ease-out 1.3s forwards;
}

@keyframes smileDraw {
    to {
        stroke-dashoffset: 0;
    }
}

.bull-tail {
    animation: tailWag 0.4s ease-in-out infinite 1.5s;
    transform-origin: 210px 180px;
}

@keyframes tailWag {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(20deg);
    }
}

.bull-leg {
    animation: legKick 0.3s ease-in-out 2;
    transform-origin: bottom;
}

.bull-leg:nth-of-type(1) {
    animation-delay: 1s;
}

.bull-leg:nth-of-type(2) {
    animation-delay: 1.15s;
}

@keyframes legKick {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* TICK INTEGRADO - Aparece sobre el toro */
.tick-group {
    animation: tickFadeIn 0.5s ease-out 1.6s forwards;
}

@keyframes tickFadeIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tick-mark {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawTick 0.8s ease-out 1.8s forwards;
}

@keyframes drawTick {
    to {
        stroke-dashoffset: 0;
    }
}

/* Anillo pulsante alrededor del toro */
.success-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    border: 4px solid #28a745;
    border-radius: 50%;
    opacity: 0;
    animation: ringPulse 2s ease-out 2s infinite;
}

@keyframes ringPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0;
    }
}

/* Texto de confirmación */
.success-text {
    margin-top: 40px;
    animation: textSlideUp 0.8s ease-out 1.4s forwards;
    opacity: 0;
}

@keyframes textSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-text h2 {
    font-size: 2.5rem;
    color: var(--color-granate);
    font-weight: 800;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(139, 0, 0, 0.5);
    animation: textGlow 1.5s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(139, 0, 0, 0.5);
    }
    50% {
        text-shadow: 0 0 30px rgba(139, 0, 0, 0.8), 0 0 40px rgba(139, 0, 0, 0.6);
    }
}

.success-text p {
    font-size: 1.2rem;
    color: var(--color-white);
    opacity: 0.9;
}

/* Confeti */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 15px;
    background: var(--color);
    top: -10%;
    opacity: 0;
    animation: confettiFall 3s ease-out forwards;
    animation-delay: calc(var(--i) * 0.1s);
}

.confetti:nth-child(odd) {
    width: 8px;
    height: 12px;
    border-radius: 50%;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(150vh) rotate(720deg);
        left: calc(var(--i) * 7%);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .form-container {
        padding: 30px 20px;
    }

    .submit-btn {
        font-size: 1.1rem;
    }
    
    .bull-container {
        width: 280px;
        height: 280px;
    }
    
    .success-ring {
        width: 220px;
        height: 220px;
    }
    
    .success-text h2 {
        font-size: 2rem;
    }
    
    .success-text p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .form-container {
        padding: 25px 15px;
    }
    
    .bull-container {
        width: 240px;
        height: 240px;
    }
    
    .success-ring {
        width: 180px;
        height: 180px;
    }
    
    .success-text h2 {
        font-size: 1.6rem;
    }
    
    .success-text p {
        font-size: 0.9rem;
    }
}
