@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

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

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.login-container {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

/* Panel de marca */
.brand-panel {
    flex: 1;
    background: linear-gradient(135deg, #16bfb2 0%, #0b67b2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
    position: relative;
    overflow: hidden;
}

.brand-panel::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: float 6s ease-in-out infinite;
}

.brand-content {
    text-align: center;
    color: white;
    z-index: 2;
    position: relative;
    max-width: 500px;
    padding: 2rem;
}

.logo-container {
    margin-bottom: 2rem;
    animation: slideInUp 0.8s ease-out;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.brand-logo {
    max-width: 200px;
    width: 100%;
  height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
    display: block;
    margin: 0 auto;
}

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

/* Asegurar centrado del logo en todas las pantallas */
@media (min-width: 1024px) {
    .brand-logo {
        width: 70%;
        max-width: 400px;
        height: auto;
        display: block;
        margin: 0 auto;
    }
    
    .logo-container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }
}

.brand-text {
    margin-bottom: 3rem;
    animation: slideInUp 0.8s ease-out 0.2s both;
}

.brand-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brand-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
    line-height: 1.6;
}

.brand-features {
    animation: slideInUp 0.8s ease-out 0.4s both;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.feature-item span {
    font-weight: 500;
    font-size: 1rem;
}

/* Panel del formulario */
.form-panel {
    flex: 1;
    display: flex;
    align-items: center;
  justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    position: relative;
}

.form-container {
    width: 100%;
    max-width: 450px;
    padding: 3rem 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    animation: slideInRight 0.8s ease-out;
    position: relative;
    z-index: 1;
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

.form-subtitle {
    color: #718096;
    font-size: 1rem;
  font-weight: 400;
}

.login-form {
  width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.input-group:focus-within {
    border-color: #16bfb2;
    background: white;
    box-shadow: 0 0 0 3px rgba(22, 191, 178, 0.1);
}

.input-icon {
  display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    color: #a0aec0;
    transition: color 0.3s ease;
}

.input-group:focus-within .input-icon {
    color: #16bfb2;
}

.form-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 1rem 1rem 1rem 0;
    font-size: 1rem;
    color: #2d3748;
  outline: none;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.form-input:focus {
    color: #2d3748;
}

.form-input.error {
    color: #e53e3e;
}

.password-toggle {
    background: none;
    border: none;
    padding: 1rem;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #16bfb2;
}

.error-message {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    color: #e53e3e;
    font-size: 0.875rem;
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

.error-message svg {
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-container {
  display: flex;
  align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.3s ease;
  display: flex;
    align-items: center;
  justify-content: center;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: #16bfb2;
    border-color: #16bfb2;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label {
    color: #4a5568;
    font-size: 0.875rem;
    font-weight: 500;
}

.forgot-link {
    color: #16bfb2;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #0ea5a0;
    text-decoration: underline;
}

.submit-button {
    width: 100%;
    background: linear-gradient(135deg, #16bfb2 0%, #0ea5a0 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  display: flex;
    align-items: center;
  justify-content: center;
    min-height: 56px;
    box-shadow: 0 4px 15px rgba(22, 191, 178, 0.3);
    z-index: 1;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(22, 191, 178, 0.4);
    background: linear-gradient(135deg, #0ea5a0 0%, #16bfb2 100%);
}

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

.submit-button:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
}

.button-text {
    transition: opacity 0.3s ease;
}

.button-loader {
    position: absolute;
    display: none;
  align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animaciones */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
    }
    
    .brand-panel {
        min-height: 40vh;
        padding: 2rem 1rem;
    }
    
    .brand-title {
        font-size: 2rem;
    }
    
    .brand-subtitle {
        font-size: 1rem;
    }
    
    .feature-item {
        margin-bottom: 1rem;
        padding: 0.75rem;
    }
    
    .form-container {
        margin: 1rem;
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }
}

@media (max-width: 768px) {
    .brand-panel {
        min-height: 35vh;
        padding: 1.5rem 1rem;
    }
    
    .brand-title {
        font-size: 1.75rem;
    }
    
    .brand-subtitle {
        font-size: 0.9rem;
    }
    
    .brand-features {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }
    
    .feature-item {
        margin-bottom: 0.5rem;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .feature-icon {
        font-size: 1.2rem;
        margin-right: 0.75rem;
    }
    
    .form-container {
        margin: 0.5rem;
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }
    
    .form-title {
        font-size: 1.75rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .brand-panel {
        min-height: 30vh;
    }
    
    .brand-title {
        font-size: 1.5rem;
    }
    
    .brand-subtitle {
        font-size: 0.85rem;
    }
    
    .brand-features {
        margin-top: 1rem;
        gap: 0.5rem;
    }
    
    .feature-item {
        padding: 0.5rem;
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }
    
    .feature-icon {
        font-size: 1rem;
        margin-right: 0.5rem;
    }
    
    .form-container {
        margin: 0.25rem;
        padding: 1.25rem 0.75rem;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .input-group {
        border-radius: 8px;
    }
    
    .form-input {
        padding: 0.875rem 0.875rem 0.875rem 0;
        font-size: 0.9rem;
    }
    
    .submit-button {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
        min-height: 48px;
        box-shadow: 0 4px 12px rgba(22, 191, 178, 0.4);
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible para mejor accesibilidad */
.form-input:focus-visible,
.submit-button:focus-visible,
.password-toggle:focus-visible {
    outline: 2px solid #16bfb2;
    outline-offset: 2px;
}

/* Estados de carga */
.loading .submit-button {
    pointer-events: none;
}

.loading .button-text {
    opacity: 0;
}

.loading .button-loader {
    display: flex;
}

/* Asegurar visibilidad del botón */
.submit-button:not(:disabled) {
    background: linear-gradient(135deg, #16bfb2 0%, #0ea5a0 100%);
    color: white !important;
    border: 2px solid #16bfb2;
    opacity: 1;
    visibility: visible;
    display: flex !important;
}

.submit-button:not(:disabled):hover {
    background: linear-gradient(135deg, #0ea5a0 0%, #16bfb2 100%);
    border-color: #0ea5a0;
}

/* Estilo de respaldo para el botón */
.submit-button {
    background-color: #16bfb2 !important;
    color: white !important;
    border: 2px solid #16bfb2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1.2 !important;
}

/* Estilos para el enlace de solicitud de acceso */
.register-link-container {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.register-text {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.register-link {
    display: inline-block;
    color: #16bfb2;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid #16bfb2;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(22, 191, 178, 0.1);
}

.register-link:hover {
    background: rgba(22, 191, 178, 0.2);
    color: #0ea5a0;
    border-color: #0ea5a0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 191, 178, 0.3);
}

.register-link:focus {
    outline: 2px solid #16bfb2;
    outline-offset: 2px;
}

/* Estilos para el modal de solicitar acceso */
#modal-solicitar-acceso .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#modal-solicitar-acceso .modal-header {
    background: linear-gradient(135deg, #16bfb2 0%, #0ea5a0 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

#modal-solicitar-acceso .modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

#modal-solicitar-acceso .close {
    color: white;
    opacity: 0.8;
}

#modal-solicitar-acceso .close:hover {
    opacity: 1;
}

#modal-solicitar-acceso .alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid #16bfb2;
    border-radius: 10px;
    color: #0d47a1;
}

#modal-solicitar-acceso .form-control {
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

#modal-solicitar-acceso .form-control:focus {
    border-color: #16bfb2;
    box-shadow: 0 0 0 0.2rem rgba(22, 191, 178, 0.25);
}

#modal-solicitar-acceso .btn-primary {
    background: linear-gradient(135deg, #16bfb2 0%, #0ea5a0 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#modal-solicitar-acceso .btn-primary:hover {
    background: linear-gradient(135deg, #0ea5a0 0%, #16bfb2 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(22, 191, 178, 0.3);
}

#modal-solicitar-acceso .btn-secondary {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    background: #6c757d;
    border-color: #6c757d;
    color: white;
    transition: all 0.3s ease;
}

#modal-solicitar-acceso .btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

#modal-solicitar-acceso .btn-secondary:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5);
}

#modal-solicitar-acceso .form-group label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

#modal-solicitar-acceso .form-text {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Estilos para placeholders */
#modal-solicitar-acceso .form-control::placeholder {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.9rem;
}

#modal-solicitar-acceso .form-control:focus::placeholder {
    color: #d1d5db;
    transition: color 0.3s ease;
}

/* Placeholders para el formulario original */
.form-control::placeholder {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

.form-control:focus::placeholder {
    color: #adb5bd;
    transition: color 0.3s ease;
}