@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --primary-color: #2b0177;           /* Morado oscuro base */
    --secondary-color: #3b0d9e;         /* Morado medio */
    --accent-color: #591fc1;            /* Morado claro */
    --highlight-color: #c506f0;         /* Magenta brillante */
    --dark-color: rgba(0, 0, 0, 0.85);  /* Fondo principal oscuro */
    --light-color: #ffffff;             /* Texto blanco */
    --background-color: #1a1a1a;        /* Fondo general negro */
    --form-text-color: #2d2d2d;         /* Texto del formulario - gris oscuro para buen contraste */
    --form-placeholder-color: #6b7280;  /* Color de placeholder más visible */
    --border-radius: 12px;
    --box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    --transition-speed: 0.3s;
}

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

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000; /* Fondo completamente negro */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    overflow-x: hidden;
}

/* Elementos decorativos con colores morados */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 20%, rgba(43, 1, 119, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(89, 31, 193, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(197, 6, 240, 0.05) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
    animation: floatingCircles1 30s ease-in-out infinite;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 70% 30%, rgba(59, 13, 158, 0.05) 0%, transparent 60%),
        radial-gradient(circle at 30% 70%, rgba(89, 31, 193, 0.06) 0%, transparent 55%);
    z-index: 0;
    pointer-events: none;
    animation: floatingCircles2 35s ease-in-out infinite reverse;
}

@keyframes floatingCircles1 {
    0%, 100% {
        transform: translateX(0) translateY(0) scale(1);
    }
    25% {
        transform: translateX(-20px) translateY(-30px) scale(1.1);
    }
    50% {
        transform: translateX(-40px) translateY(0) scale(0.9);
    }
    75% {
        transform: translateX(-20px) translateY(30px) scale(1.05);
    }
}

@keyframes floatingCircles2 {
    0%, 100% {
        transform: translateX(0) translateY(0) scale(1);
    }
    33% {
        transform: translateX(30px) translateY(-20px) scale(0.95);
    }
    66% {
        transform: translateX(60px) translateY(20px) scale(1.08);
    }
}

.container {
    max-width: 500px;
    width: 100%;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.form-wrapper {
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(89, 31, 193, 0.3);
    position: relative;
    background: linear-gradient(145deg, rgba(43, 1, 119, 0.35), rgba(59, 13, 158, 0.28));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(89, 31, 193, 0.25);
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.form-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(197, 6, 240, 0.4);
}

.logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
    display: block;
    margin: 0 auto 2rem auto;
    filter: brightness(1.2) contrast(1.1);
    border-radius: 5px
}

.logo:hover {
    transform: scale(1.05);
}

.logo2 {
    max-width: 150px;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-top: -1.5rem;
    margin-bottom: 1rem;
    opacity: 0.85;
    transition: transform 0.3s ease;
    filter: brightness(1.2) contrast(1.1);
}

.logo2:hover {
    transform: scale(1.05);
}

.input-group {
    position: relative;
}

.input-group-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--light-color);
    border: none;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px 0 0 8px;
}

.form-control, .form-select {
    border: 2px solid rgba(89, 31, 193, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #2d2d2d;
    transition: all var(--transition-speed) ease;
}

.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 3px rgba(197, 6, 240, 0.2), 0 4px 12px rgba(89, 31, 193, 0.2);
    border-color: var(--highlight-color);
    background-color: rgba(255, 255, 255, 1);
    color: #2d2d2d;
    outline: none;
}

.form-control::placeholder {
    color: #9ca3af;
    font-size: 15px;
}

.form-control:hover, .form-select:hover {
    border-color: rgba(89, 31, 193, 0.5);
    background-color: rgba(255, 255, 255, 1);
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    color: var(--light-color);
    padding: 14px 30px;
    border-radius: 30px;
    border: none;
    width: 100%;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(197, 6, 240, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all var(--transition-speed) ease;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--highlight-color) 50%, var(--accent-color) 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(197, 6, 240, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

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

.important-notice {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(43, 1, 119, 0.2), rgba(89, 31, 193, 0.15));
    padding: 12px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(197, 6, 240, 0.3);
    animation: fadeIn 1s ease-in-out;
}

.important-notice p {
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(43, 1, 119, 0.95), rgba(59, 13, 158, 0.95));
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border-radius: var(--border-radius);
    z-index: 100;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(197, 6, 240, 0.2);
    border-top: 5px solid var(--highlight-color);
    border-radius: 50%;
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite alternate;
    margin-bottom: 1.5rem;
}

.loading-text {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    animation: fadeIn 1s ease-in-out;
}

.invalid-feedback {
    color: #ff6b9d;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
    font-weight: 500;
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.was-validated .form-select:invalid ~ .invalid-feedback {
    display: block;
}

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

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(197, 6, 240, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(197, 6, 240, 0); }
    100% { box-shadow: 0 0 0 0 rgba(197, 6, 240, 0); }
}

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

@media (max-width: 576px) {
    .container {
        padding: 10px;
    }

    .form-wrapper {
        padding: 1.5rem;
    }

    .logo {
        max-width: 500px;
        width: 100%;
        margin: 0 auto 1.5rem auto;
    }

    .form-control, .form-select {
        padding: 10px;
        font-size: 15px;
    }

    .btn-submit {
        padding: 12px;
        font-size: 16px;
    }
}

select.form-select {
    color: #2d2d2d;
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(89, 31, 193, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 16px;
    transition: all var(--transition-speed) ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23591fc1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

select.form-select:focus {
    box-shadow: 0 0 0 3px rgba(197, 6, 240, 0.2);
    border-color: var(--highlight-color);
    background-color: rgba(255, 255, 255, 1);
    color: #2d2d2d;
}

select.form-select option {
    color: #2d2d2d;
    background-color: #ffffff;
    padding: 8px;
}

@media (max-width: 375px) {
    .container {
        padding: 5px;
    }

    .form-wrapper {
        padding: 1.25rem;
    }

    .logo {
        max-width: 500px;
        width: 100%;
        margin: 0 auto 1.25rem auto;
    }
}

.form-group {
    opacity: 0;
    transform: translateY(10px);
    animation: slideIn 0.5s forwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }
.form-group:nth-child(6) { animation-delay: 0.6s; }
.form-group:nth-child(7) { animation-delay: 0.7s; }
.form-group:nth-child(8) { animation-delay: 0.8s; }
.form-group:nth-child(9) { animation-delay: 0.9s; }
.form-group:nth-child(10) { animation-delay: 1s; }

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

.form-label {
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.form-check-input {
    accent-color: var(--highlight-color);
}

.form-check-label {
    color: #ffffff;
}

h2 {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(197, 6, 240, 0.5);
}

.alert {
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.2), rgba(239, 68, 68, 0.2));
    border: 1px solid rgba(255, 107, 157, 0.4);
    color: #fff;
}

.alert-success {
    background: linear-gradient(135deg, rgba(89, 31, 193, 0.2), rgba(197, 6, 240, 0.2));
    border: 1px solid rgba(197, 6, 240, 0.4);
    color: #fff;
}
